Skip to content

Commit

Permalink
[COMPLIANCE] Add Copyright and License Headers
Browse files Browse the repository at this point in the history
  • Loading branch information
hashicorp-copywrite[bot] authored Jul 17, 2023
1 parent 551e49b commit 66b4565
Show file tree
Hide file tree
Showing 77 changed files with 385 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/basic/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export default function RootLayout({
children,
}: {
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/app/(app)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export default function Index() {
return <h1>Hello world</h1>
}
5 changes: 5 additions & 0 deletions examples/basic/app/(swingset)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import layout from 'swingset/theme'

export default layout
5 changes: 5 additions & 0 deletions examples/basic/app/(swingset)/swingset/[...path]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { generateStaticParams } from 'swingset/meta'
import { Page } from 'swingset/theme'

Expand Down
5 changes: 5 additions & 0 deletions examples/basic/app/(swingset)/swingset/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import Content from './content.mdx'

export default async function SwingsetRoot() {
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/components/accordion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { ReactElement } from 'react'

interface AccordionProps {
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/components/button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { ReactElement } from 'react'

interface ButtonProps {
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/components/card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export function Card({ children }) {
return (
<div style={{ border: '1px solid gray', borderRadius: '4px' }}>
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/components/checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export function Checkbox(props) {
return <input type="checkbox" {...props} />
}
5 changes: 5 additions & 0 deletions examples/basic/components/nested/title/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export function Title({ children }) {
return <h1>{children}</h1>
}
5 changes: 5 additions & 0 deletions examples/basic/components/text-input/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export function TextInput(props) {
return <input {...props} />
}
5 changes: 5 additions & 0 deletions examples/basic/components/text/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export default function Text({ children }) {
return <span>{children}</span>
}
5 changes: 5 additions & 0 deletions examples/basic/mdx-components.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import themeComponents from 'swingset-theme-hashicorp/MDXComponents'

export function useMDXComponents(components) {
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

/// <reference types="next" />
/// <reference types="next/image-types/global" />

Expand Down
5 changes: 5 additions & 0 deletions examples/basic/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import withSwingset from 'swingset'
import remarkGfm from 'remark-gfm'
import rehypeMdxCodeProps from 'rehype-mdx-code-props'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

module.exports = {
plugins: {
'postcss-import': {},
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/MDXComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { PropsTable } from './components/props-table'
import { Heading, Body } from './components/text'
import { LiveComponent } from './components/live-component'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

'use client'
import { SideNavigation } from './side-nav'
import { categories } from 'swingset/meta'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

'use client' //Library calls hooks internally
import { Highlight, themes } from 'prism-react-renderer'
import { parseCode, parseLanguage } from './helpers'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

'use client'
import {
IconDuplicate16,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { Language, MDXPreClass, MDXPreElement } from '@/types'

export const parseCode = (toParse: MDXPreElement | string): string => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { CodeBlock } from './code-block'

export { CodeBlock }
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export const CustomTheme = {
colors: {
accent: 'inherit',
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/components/link.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { type ComponentProps } from 'react'
import NextLink from 'next/link'
import { cx } from 'class-variance-authority'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { SandpackTheme } from '@codesandbox/sandpack-react/types'

const sandpackTheme: SandpackTheme = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import type { SandpackFile } from '@codesandbox/sandpack-react'
import { parseCode } from '../code-block/helpers'
import { MDXPreElement } from '@/types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

'use client'
import {
SandpackProvider,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

'use client'

export function OpenInEditor({ path }: { path: string }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { ComponentType, ReactNode } from 'react'

interface PropsTableProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { NavigationNode, ComponentNode } from 'swingset/types'
import { LinkItem } from './link-item'
import { cx } from 'class-variance-authority'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { NavigationTree } from 'swingset/types'
import Category from './category'
import { Link } from '../link'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { Link } from '../link'
import { cx } from 'class-variance-authority'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { IconChevronLeft24 } from '@hashicorp/flight-icons/svg-react/chevron-left-24'
import { cx } from 'class-variance-authority'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { cva, VariantProps, cx } from 'class-variance-authority'
import { type HTMLAttributes } from 'react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { cva, VariantProps, cx } from 'class-variance-authority'
import { type HTMLAttributes } from 'react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { Heading } from './heading'
import { Body } from './body'

Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

@tailwind base;
@tailwind components;
@tailwind utilities;
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

// NOTE: global css import needs to be at the top so component-specific CSS is loaded after the theme reset (component-specific CSS is loaded as a result of the swingset/meta import below)
import '../style.css'
import React from 'react'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { ComponentEntity, EvaluatedEntity } from 'swingset/types'
import { Heading, Body } from './components/text'
import { OpenInEditor } from './components/open-in-editor'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export type Language = 'ts' | 'js' | 'jsx' | 'tsx'

export type MDXPreClass = `language-${Language}`
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

const colors = require('tailwindcss/colors')

/** @type {import('tailwindcss').Config} */
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { Buffer } from 'node:buffer'
import { defineConfig } from 'tsup'

Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/__tests__/get-navigation-tree.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { describe, it } from 'vitest'
import { getNavigationTree } from '../src/get-navigation-tree'
import { ComponentEntity, NavigationTree } from '../src/types'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/__tests__/parse-component-path.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { describe, it } from 'vitest'
import { parseComponentPath } from '../src/parse-component-path'

Expand Down
Loading

0 comments on commit 66b4565

Please sign in to comment.