Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/studio-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
# On push events paths-filter diffs against github.event.before with
# local git; without enough history it falls back to a git fetch that
# fails unauthenticated (persist-credentials is false).
fetch-depth: 50
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/studio-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
# On push events paths-filter diffs against github.event.before with
# local git; without enough history it falls back to a git fetch that
# fails unauthenticated (persist-credentials is false).
fetch-depth: 50
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/studio-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
# On push events paths-filter diffs against github.event.before with
# local git; without enough history it falls back to a git fetch that
# fails unauthenticated (persist-credentials is false).
fetch-depth: 50
sparse-checkout: |
apps/studio
packages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import { RadioGroupCard, RadioGroupCardItem } from 'ui'
```

```tsx
<RadioGroupCard defaultValue="comfortable">
<RadioGroupCardItem value="default" id="r1" label="Default" />
<RadioGroupCardItem value="comfortable" id="r2" label="Comfortable" />
<RadioGroupCardItem value="compact" id="r3" label="Compact" />
<RadioGroupCard defaultValue="comfortable" aria-label="Size">
<RadioGroupCardItem value="default" label="Default" />
<RadioGroupCardItem value="comfortable" label="Comfortable" />
<RadioGroupCardItem value="compact" label="Compact" />
</RadioGroupCard>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { RadioGroupStacked, RadioGroupStackedItem } from 'ui'
```

```tsx
<RadioGroupStacked defaultValue="comfortable">
<RadioGroupStacked defaultValue="comfortable" aria-label="Size">
<RadioGroupStackedItem value="default" id="r1" label="Default" />
<RadioGroupStackedItem value="comfortable" id="r2" label="Comfortable" />
<RadioGroupStackedItem value="compact" id="r3" label="Compact" />
Expand Down
2 changes: 1 addition & 1 deletion apps/design-system/content/docs/components/radio-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'
```

```tsx
<RadioGroup defaultValue="option-one">
<RadioGroup defaultValue="option-one" aria-label="Options">
<div className="flex items-center space-x-2">
<RadioGroupItem value="option-one" id="option-one" />
<Label htmlFor="option-one">Option One</Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { RadioGroupCard, RadioGroupCardItem } from 'ui'

export default function RadioGroupDemo() {
return (
<RadioGroupCard defaultValue="comfortable" className="flex flex-wrap gap-3">
<RadioGroupCardItem value="default" id="r1" label="Default" />
<RadioGroupCardItem value="comfortable" id="r2" label="Comfortable" />
<RadioGroupCardItem value="compact" id="r3" label="Compact" />
<RadioGroupCard defaultValue="comfortable" className="flex flex-wrap gap-3" aria-label="Size">
<RadioGroupCardItem value="default" label="Default" />
<RadioGroupCardItem value="comfortable" label="Comfortable" />
<RadioGroupCardItem value="compact" label="Compact" />
</RadioGroupCard>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,9 @@ export default function RadioGroupForm() {
defaultValue={field.value}
className="flex flex-wrap gap-3"
>
<FormItem asChild>
<FormControl>
<RadioGroupCardItem value="all" label="All new messages" />
</FormControl>
</FormItem>
<FormItem asChild>
<FormControl>
<RadioGroupCardItem value="mentions" label="Direct messages and mentions" />
</FormControl>
</FormItem>
<FormItem asChild>
<FormControl>
<RadioGroupCardItem value="none" label="Nothing" />
</FormControl>
</FormItem>
<RadioGroupCardItem value="all" label="All new messages" />
<RadioGroupCardItem value="mentions" label="Direct messages and mentions" />
<RadioGroupCardItem value="none" label="Nothing" />
</RadioGroupCard>
</FormControl>
<FormMessage />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function RadioGroupDemo() {
] as const

return (
<RadioGroupCard defaultValue="comfortable" className="flex flex-wrap gap-3">
<RadioGroupCard defaultValue="dark" className="flex flex-wrap gap-3" aria-label="Theme">
{singleThemes.map((theme) => (
<RadioGroupCardItem key={theme.value} value={theme.value} label={theme.name}>
<SVG src={`${process.env.NEXT_PUBLIC_BASE_PATH}/img/themes/${theme.value}.svg`} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Label, RadioGroup, RadioGroupItem } from 'ui'

export default function RadioGroupDemo() {
return (
<RadioGroup defaultValue="comfortable">
<RadioGroup defaultValue="comfortable" aria-label="Size">
<div className="flex items-center space-x-2">
<RadioGroupItem value="default" id="r1" />
<Label htmlFor="r1">Default</Label>
Expand Down
36 changes: 18 additions & 18 deletions apps/design-system/registry/default/example/radio-group-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,24 @@ export default function RadioGroupForm() {
defaultValue={field.value}
className="flex flex-col space-y-1"
>
<FormItem className="flex items-center space-x-3 space-y-0">
<FormControl>
<RadioGroupItem value="all" />
</FormControl>
<FormLabel className="font-normal">All new messages</FormLabel>
</FormItem>
<FormItem className="flex items-center space-x-3 space-y-0">
<FormControl>
<RadioGroupItem value="mentions" />
</FormControl>
<FormLabel className="font-normal">Direct messages and mentions</FormLabel>
</FormItem>
<FormItem className="flex items-center space-x-3 space-y-0">
<FormControl>
<RadioGroupItem value="none" />
</FormControl>
<FormLabel className="font-normal">Nothing</FormLabel>
</FormItem>
<div className="flex items-center space-x-3 space-y-0">
<RadioGroupItem value="all" id="type-all" />
<FormLabel className="font-normal" htmlFor="type-all">
All new messages
</FormLabel>
</div>
<div className="flex items-center space-x-3 space-y-0">
<RadioGroupItem value="mentions" id="type-mentions" />
<FormLabel className="font-normal" htmlFor="type-mentions">
Direct messages and mentions
</FormLabel>
</div>
<div className="flex items-center space-x-3 space-y-0">
<RadioGroupItem value="none" id="type-none" />
<FormLabel className="font-normal" htmlFor="type-none">
Nothing
</FormLabel>
</div>
</RadioGroup>
</FormControl>
<FormMessage />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { RadioGroupStacked, RadioGroupStackedItem } from 'ui'

export default function RadioGroupDemo() {
return (
<RadioGroupStacked defaultValue="comfortable">
<RadioGroupStacked defaultValue="comfortable" aria-label="Size">
<RadioGroupStackedItem
value="default"
id="r1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,9 @@ export default function RadioGroupForm() {
<FormLabel>Notify me about...</FormLabel>
<FormControl>
<RadioGroupStacked onValueChange={field.onChange} defaultValue={field.value}>
<FormItem asChild>
<FormControl>
<RadioGroupStackedItem value="all" label="All new messages" />
</FormControl>
</FormItem>
<FormItem asChild>
<FormControl>
<RadioGroupStackedItem
value="mentions"
label="Direct messages and mentions"
/>
</FormControl>
</FormItem>
<FormItem asChild>
<FormControl>
<RadioGroupStackedItem value="none" label="Nothing" />
</FormControl>
</FormItem>
<RadioGroupStackedItem value="all" label="All new messages" />
<RadioGroupStackedItem value="mentions" label="Direct messages and mentions" />
<RadioGroupStackedItem value="none" label="Nothing" />
</RadioGroupStacked>
</FormControl>
<FormMessage />
Expand Down
1 change: 0 additions & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"codegen:references:new": "pnpm run codegen:references:new:ensure && tsx scripts/build-reference-content.ts",
"codegen:references:legacy": "tsx features/docs/Reference.generated.script.ts",
"codegen:references": "pnpm codegen:references:legacy && pnpm codegen:references:new",
"codemod:frontmatter": "node ./scripts/codemod/mdx-meta.mjs && prettier --cache --write \"content/**/*.mdx\"",
"dev": "run-p --race dev:next dev:watch:troubleshooting",
"dev:next": "next dev --port 3001",
"dev:secrets:pull": "AWS_PROFILE=supa-dev node ../../scripts/getSecrets.js -n local/docs",
Expand Down
24 changes: 24 additions & 0 deletions apps/kb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# build output
dist/

# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# jetbrains setting folder
.idea/
36 changes: 36 additions & 0 deletions apps/kb/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Development

When starting the dev server, run:

```
# From the root directory of the project
pnpm dev:kb

# From the apps/kb directory
pnpm dev
```

## Build

To run a full production build, run:

```
# From the root directory of the project
pnpm build:kb

# From the apps/kb directory
pnpm build
```

## Documentation

Full documentation: https://docs.astro.build

Consult these guides before working on related tasks:

- [Adding pages, dynamic routes, or middleware](https://docs.astro.build/en/guides/routing/)
- [Working with Astro components](https://docs.astro.build/en/basics/astro-components/)
- [Using React, Vue, Svelte, or other framework components](https://docs.astro.build/en/guides/framework-components/)
- [Adding or managing content](https://docs.astro.build/en/guides/content-collections/)
- [Adding styles or using Tailwind](https://docs.astro.build/en/guides/styling/)
- [Supporting multiple languages](https://docs.astro.build/en/guides/internationalization/)
1 change: 1 addition & 0 deletions apps/kb/CLAUDE.md
46 changes: 46 additions & 0 deletions apps/kb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Astro Starter Kit: Basics

```sh
npm create astro@latest -- --template basics
```

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!

## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

```text
/
├── public/
│ └── favicon.svg
├── src
│   ├── assets
│   │   └── astro.svg
│   ├── components
│   │   └── Welcome.astro
│   ├── layouts
│   │   └── Layout.astro
│   └── pages
│   └── index.astro
└── package.json
```

To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/).

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
47 changes: 47 additions & 0 deletions apps/kb/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// @ts-check
import { createRequire } from 'node:module'
import path from 'node:path'

import react from '@astrojs/react'
import tailwindcss from '@tailwindcss/vite'
import { defineConfig } from 'astro/config'

// Absolute dir of lodash-es, for the SSR-only lodash alias below (same fix
// apps/studio/vite.config.ts uses). `packages/ui`'s clipboard util does
// `import { noop } from 'lodash'` — under Vite's dev-mode SSR module runner,
// that CJS import evaluates as pure ESM (no module/exports/require), so the
// named import binds to undefined. lodash-es is real ESM and the same
// version, so swapping it in for SSR only (client bundles are untouched)
// fixes it without touching the shared `ui` package.
const lodashEsDir = path.dirname(createRequire(import.meta.url).resolve('lodash-es/package.json'))

// Not typed as `import('vite').Plugin` — kb's own `vite` (from the pnpm
// catalog) and Astro's internal vite dependency resolve to distinct type
// instances, and comparing them blows TS's structural-comparison stack depth.
const ssrLodashEs = {
name: 'kb-ssr-lodash-es',
enforce: 'pre',
/**
* @param {string} source
* @param {string | undefined} _importer
* @param {{ ssr?: boolean } | undefined} options
*/
resolveId(source, _importer, options) {
if (!options?.ssr) return
if (source === 'lodash') return path.join(lodashEsDir, 'lodash.js')
const subpath = source.match(/^lodash\/(.+?)(\.js)?$/)
if (subpath) return path.join(lodashEsDir, `${subpath[1]}.js`)
},
}

// https://astro.build/config
export default defineConfig({
base: '/kb',
integrations: [react()],
vite: {
ssr: {
noExternal: ['lodash'],
},
plugins: [tailwindcss(), ssrLodashEs],
},
})
Loading
Loading