@tc96/cli 0.0.0-stage → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +213 -2
- package/cli.js +1450 -0
- package/package.json +35 -4
- package/registry/agenda-1.json +1297 -0
- package/registry/aggregate.json +4 -0
- package/registry/ai-chat-1.json +91 -0
- package/registry/app-shell-1.json +81 -0
- package/registry/app-shell-2.json +89 -0
- package/registry/app-shell-3.json +109 -0
- package/registry/app-shell-4.json +104 -0
- package/registry/card-1.json +104 -0
- package/registry/card-2.json +97 -0
- package/registry/card-3.json +104 -0
- package/registry/card-4.json +98 -0
- package/registry/card-5.json +85 -0
- package/registry/card-6.json +98 -0
- package/registry/card-7.json +104 -0
- package/registry/card-8.json +106 -0
- package/registry/card-9.json +92 -0
- package/registry/charts.json +30 -0
- package/registry/chat-assistant.json +110 -0
- package/registry/chats-panel.json +97 -0
- package/registry/checklist.json +321 -0
- package/registry/collection.json +1104 -0
- package/registry/crm-1.json +1317 -0
- package/registry/crm-2.json +1400 -0
- package/registry/dashboard-1.json +160 -0
- package/registry/dashboard-2.json +153 -0
- package/registry/dashboard-3.json +154 -0
- package/registry/dashboard-4.json +168 -0
- package/registry/dashboard-5.json +167 -0
- package/registry/dashboard-6.json +143 -0
- package/registry/dashboard-7.json +188 -0
- package/registry/documents-1.json +1322 -0
- package/registry/editable.json +36 -0
- package/registry/empty-state-1.json +40 -0
- package/registry/empty-state-2.json +39 -0
- package/registry/empty-state-3.json +61 -0
- package/registry/empty-state-4.json +39 -0
- package/registry/empty-state-5.json +47 -0
- package/registry/empty-state-6.json +40 -0
- package/registry/finance-1.json +845 -0
- package/registry/finance-2.json +973 -0
- package/registry/finance-3.json +1436 -0
- package/registry/flow-1.json +460 -0
- package/registry/flow-2.json +503 -0
- package/registry/flow-3.json +198 -0
- package/registry/flow-4.json +75 -0
- package/registry/flow-canvas.json +198 -0
- package/registry/flow-inspector.json +151 -0
- package/registry/flow-step-library.json +112 -0
- package/registry/forgot-password-1.json +73 -0
- package/registry/forgot-password-2.json +73 -0
- package/registry/inbox-1.json +1184 -0
- package/registry/inventory-1.json +828 -0
- package/registry/inventory-2.json +956 -0
- package/registry/legal-1.json +1345 -0
- package/registry/legal-2.json +1279 -0
- package/registry/legal-3.json +1273 -0
- package/registry/legal-4.json +1273 -0
- package/registry/legal-5.json +1393 -0
- package/registry/legal-6.json +1309 -0
- package/registry/legal-7.json +1315 -0
- package/registry/legal-8.json +1358 -0
- package/registry/legal-9.json +1381 -0
- package/registry/list-1.json +129 -0
- package/registry/list-2.json +117 -0
- package/registry/list-3.json +129 -0
- package/registry/list-4.json +105 -0
- package/registry/list-5.json +98 -0
- package/registry/list-6.json +92 -0
- package/registry/list.json +52 -0
- package/registry/login-1.json +89 -0
- package/registry/login-10.json +88 -0
- package/registry/login-2.json +81 -0
- package/registry/login-3.json +90 -0
- package/registry/login-4.json +81 -0
- package/registry/login-5.json +82 -0
- package/registry/login-6.json +88 -0
- package/registry/login-7.json +83 -0
- package/registry/login-8.json +81 -0
- package/registry/login-9.json +88 -0
- package/registry/magic-link-6.json +79 -0
- package/registry/marketing-1.json +833 -0
- package/registry/marketing-2.json +961 -0
- package/registry/navbar-1.json +66 -0
- package/registry/navbar-10.json +50 -0
- package/registry/navbar-11.json +48 -0
- package/registry/navbar-12.json +48 -0
- package/registry/navbar-2.json +48 -0
- package/registry/navbar-3.json +50 -0
- package/registry/navbar-4.json +39 -0
- package/registry/navbar-5.json +50 -0
- package/registry/navbar-6.json +48 -0
- package/registry/navbar-7.json +72 -0
- package/registry/navbar-8.json +50 -0
- package/registry/navbar-9.json +54 -0
- package/registry/onboarding-1.json +114 -0
- package/registry/onboarding-2.json +78 -0
- package/registry/onboarding-3.json +71 -0
- package/registry/otp-1.json +73 -0
- package/registry/projects-1.json +865 -0
- package/registry/projects-2.json +993 -0
- package/registry/projects-3.json +1346 -0
- package/registry/properties.json +530 -0
- package/registry/record-dialog.json +88 -0
- package/registry/record-group.json +194 -0
- package/registry/record-preview.json +70 -0
- package/registry/record-status-list.json +70 -0
- package/registry/reset-password-1.json +92 -0
- package/registry/reset-password-2.json +98 -0
- package/registry/reset-password-6.json +91 -0
- package/registry/revenue-1.json +834 -0
- package/registry/revenue-2.json +968 -0
- package/registry/revenue-3.json +821 -0
- package/registry/revenue-4.json +949 -0
- package/registry/rich-text-editor-1.json +172 -0
- package/registry/rich-text-editor-2.json +158 -0
- package/registry/rich-text-editor-3.json +198 -0
- package/registry/rich-text-editor-4.json +200 -0
- package/registry/rich-text-editor-5.json +237 -0
- package/registry/rich-text-editor.json +113 -0
- package/registry/settings-account-1.json +119 -0
- package/registry/settings-account-2.json +118 -0
- package/registry/settings-catalog-1.json +128 -0
- package/registry/settings-catalog-10.json +129 -0
- package/registry/settings-catalog-2.json +116 -0
- package/registry/settings-catalog-3.json +118 -0
- package/registry/settings-catalog-4.json +227 -0
- package/registry/settings-catalog-5.json +129 -0
- package/registry/settings-catalog-6.json +130 -0
- package/registry/settings-catalog-7.json +130 -0
- package/registry/settings-catalog-8.json +183 -0
- package/registry/settings-catalog-9.json +159 -0
- package/registry/settings-integration-1.json +125 -0
- package/registry/settings-integration-2.json +122 -0
- package/registry/settings-integration-3.json +118 -0
- package/registry/settings-integration-4.json +129 -0
- package/registry/settings-integration-5.json +122 -0
- package/registry/settings-integration-6.json +92 -0
- package/registry/settings-integration-7.json +122 -0
- package/registry/settings-integration-8.json +593 -0
- package/registry/settings-notification-channel-1.json +112 -0
- package/registry/settings-preference-1.json +123 -0
- package/registry/settings-preference-2.json +123 -0
- package/registry/settings-preference-3.json +116 -0
- package/registry/settings-role-permission-1.json +117 -0
- package/registry/settings-security-1.json +117 -0
- package/registry/settings-workspace-1.json +119 -0
- package/registry/settings-workspace-2.json +125 -0
- package/registry/settings.json +82 -0
- package/registry/signup-1.json +100 -0
- package/registry/signup-2.json +93 -0
- package/registry/signup-3.json +83 -0
- package/registry/signup-6.json +99 -0
- package/registry/state-surface.json +58 -0
- package/registry/stats-1.json +116 -0
- package/registry/stats-2.json +115 -0
- package/registry/stats-3.json +97 -0
- package/registry/stats-4.json +92 -0
- package/registry/stats-5.json +103 -0
- package/registry/stats-6.json +105 -0
- package/registry/stats-7.json +103 -0
- package/registry/stats.json +64 -0
- package/registry/support-1.json +853 -0
- package/registry/support-2.json +981 -0
- package/registry/support-3.json +762 -0
- package/registry/support-4.json +538 -0
- package/registry/team-1.json +829 -0
- package/registry/team-2.json +957 -0
- package/registry/timeline-1.json +97 -0
- package/registry/timeline-2.json +102 -0
- package/registry/timeline-3.json +68 -0
- package/registry/timeline-4.json +86 -0
- package/registry/ui/accordion.json +15 -0
- package/registry/ui/alert-dialog.json +14 -0
- package/registry/ui/alert.json +50 -0
- package/registry/ui/autocomplete.json +18 -0
- package/registry/ui/avatar.json +14 -0
- package/registry/ui/badge.json +51 -0
- package/registry/ui/breadcrumb.json +15 -0
- package/registry/ui/button.json +25 -0
- package/registry/ui/calendar.json +15 -0
- package/registry/ui/card.json +14 -0
- package/registry/ui/chat.json +115 -0
- package/registry/ui/checkbox-group.json +14 -0
- package/registry/ui/checkbox.json +14 -0
- package/registry/ui/collapsible.json +14 -0
- package/registry/ui/combobox.json +18 -0
- package/registry/ui/command.json +17 -0
- package/registry/ui/composer-clipboard.json +14 -0
- package/registry/ui/composer-document.json +14 -0
- package/registry/ui/composer-editor.json +16 -0
- package/registry/ui/composer-query.json +12 -0
- package/registry/ui/composer.json +17 -0
- package/registry/ui/context-menu.json +23 -0
- package/registry/ui/dialog.json +18 -0
- package/registry/ui/drawer.json +18 -0
- package/registry/ui/empty.json +14 -0
- package/registry/ui/field.json +22 -0
- package/registry/ui/fieldset.json +14 -0
- package/registry/ui/form.json +14 -0
- package/registry/ui/frame.json +12 -0
- package/registry/ui/gauge.json +31 -0
- package/registry/ui/group.json +17 -0
- package/registry/ui/icon-frame.json +31 -0
- package/registry/ui/input-group.json +17 -0
- package/registry/ui/input.json +14 -0
- package/registry/ui/kbd.json +12 -0
- package/registry/ui/label.json +14 -0
- package/registry/ui/menu.json +39 -0
- package/registry/ui/meter.json +14 -0
- package/registry/ui/number-field.json +17 -0
- package/registry/ui/otp-field.json +31 -0
- package/registry/ui/pagination.json +17 -0
- package/registry/ui/popover.json +14 -0
- package/registry/ui/preview-card.json +14 -0
- package/registry/ui/progress.json +14 -0
- package/registry/ui/property-meta.json +16 -0
- package/registry/ui/property-tone.json +12 -0
- package/registry/ui/radio-group.json +14 -0
- package/registry/ui/render-anchor.json +12 -0
- package/registry/ui/scroll-area.json +14 -0
- package/registry/ui/segmented-control.json +14 -0
- package/registry/ui/select.json +16 -0
- package/registry/ui/separator.json +14 -0
- package/registry/ui/sheet.json +18 -0
- package/registry/ui/sidebar.json +25 -0
- package/registry/ui/skeleton.json +24 -0
- package/registry/ui/slider.json +14 -0
- package/registry/ui/spinner.json +14 -0
- package/registry/ui/switch.json +14 -0
- package/registry/ui/table.json +14 -0
- package/registry/ui/tabs.json +16 -0
- package/registry/ui/text.json +31 -0
- package/registry/ui/textarea.json +14 -0
- package/registry/ui/toast.json +89 -0
- package/registry/ui/toggle-group.json +18 -0
- package/registry/ui/toggle.json +15 -0
- package/registry/ui/toolbar.json +14 -0
- package/registry/ui/tooltip.json +14 -0
- package/registry/ui/use-composer-editor.json +17 -0
- package/registry/ui/use-copy-to-clipboard.json +12 -0
- package/registry/ui/use-media-query.json +12 -0
- package/registry/view.json +1104 -0
- package/registry/widgets.json +319 -0
- package/registry/wizard.json +89 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "alert",
|
|
3
|
+
"type": "registry:ui",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"path": "registry/default/ui/alert/ACCESSIBILITY.md",
|
|
7
|
+
"content": "# Alert accessibility\n\nLocal accessibility and usability decisions for the alert parts. The repo-wide rules (WCAG thresholds, contrast fixed without changing token values, axe in every story) are in `docs/accessibility.md`; this file holds what applies only to the alert. Measured on 2026-11-20 on every variant with an icon, title and description, `Default` theme preset, colors composed on the page `background`; the 2026-11-02 record (`docs/accessibility.md`, `Flow Inspector, Alert e Toast do COSS`) gave the same values.\n\n## Roles and names\n\n- The root is a `div` with `role=\"alert\"`, an assertive live region: a screen reader announces it as soon as it is inserted. Render it when the message happens. A message that is on screen from the first render, as a standing notice, passes `role=\"status\"` or no live role; props spread after the default.\n- The alert has no accessible name of its own; the title and description are read as its content.\n- An icon that carries the status takes `role=\"img\"` and an `aria-label` (`Warning`); an icon the title already explains takes `aria-hidden=\"true\"`.\n\n## Keyboard and focus\n\n- The alert is not focusable and does not move focus. Its actions are `Button`s in the tab order where they appear.\n\n## Contrast\n\nText is measured against 4.5:1, the icon (non-text) against 3:1, each over the alert background composed on the page `background`.\n\n| Variant | Title, light / dark | Description, light / dark | Icon, light / dark |\n| --- | --- | --- | --- |\n| `default` | 14.52:1 / 15.02:1 | 5.48:1 / 5.00:1 | 5.48:1 / 5.00:1 |\n| `error` | 13.54:1 / 15.81:1 | 5.11:1 / 5.27:1 | 4.26:1 / 3.62:1 |\n| `info` | 13.87:1 / 15.40:1 | 5.24:1 / 5.13:1 | 3.44:1 / 4.47:1 |\n| `success` | 13.76:1 / 15.16:1 | 5.19:1 / 5.05:1 | 4.87:1 / 8.53:1 |\n| `warning` | 13.74:1 / 14.97:1 | 5.19:1 / 4.98:1 | 4.56:1 / 9.48:1 |\n\nThe COSS `success` and `warning` icons read `--success` and `--warning`, which measured 2.29:1 and 1.99:1 in light (2026-11-02). The consumer's stylesheet fixes them without changing a token value or `alert.tsx`: `[data-slot=\"alert\"]` redefines `--success` as `--success-foreground` and `--warning` as `--warning-foreground` (`apps/example/packages/ui/src/styles.css`), so the icon and the 4% tint of those two variants come from the darker shade. A consumer without that rule gets the failing icons back in light; that is why the flow inspector also sets `[&>svg]:text-warning-foreground` on its own alert. Color never carries the status alone: the title names it.\n\n## Layout that carries meaning\n\n- From `sm` the action sits after the text, centered across the title and the description; below `sm` it drops under the text, so the buttons never squeeze the copy on a phone.\n- The icon column opens only for an `svg` that is a direct child; the title and description then start at the same edge, after the icon.\n\n## Verified by\n\nThe plays of `UI/Alert/Behavior` check the `alert` role and slots, the `status` role a standing notice passes, the named status icon of each variant, the `aria-hidden` icon and the text column after it, the action callbacks and the 10px gap between description paragraphs; axe runs on every story in the `storybook` and `storybook-dark` projects.\n"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"path": "registry/default/ui/alert/AGENTS.md",
|
|
11
|
+
"content": "# Alert\n\nAn alert is a callout in the flow of the page that tells the user something they should act on or know now: a failed payment, a trial about to end, a new version to reload, a step that nothing reaches. It holds an optional status icon, a title, a description of one or more paragraphs and optional actions. It is announced when it appears (`role=\"alert\"`), so it is rendered when the message happens, not as static copy on load.\n\nThe parts come from COSS and are owned by this repo (ADR 0008): every change to how a part looks starts in `TOKENS.md`, the blueprint, and is then copied into `alert.tsx`; a pattern never recreates or wraps a part to restyle it (decision of 2026-11-19). The Storybook node `UI/Alert` documents it in six pages: `API Reference` (MDX: import, anatomy and the contract of each part), `Playground` (title, description, variant, icon and actions as controls), `Stories` (one story per variant on the icon, title and description base, with the variant fixed and the texts, icon and actions as controls), `Behavior` (one `play` per guarantee), `Usages` (real messages) and `Layouts` (the base without an icon or description, with actions, with paragraphs); `Get Started/Component Docs` sets that structure.\n\n## Map\n\n- `alert.tsx`: `Alert`, `AlertTitle`, `AlertDescription` and `AlertAction`.\n- `index.ts`: the barrel `@tc96/ui/alert` resolves to.\n- `TOKENS.md`: the blueprint and single source of truth of the look: the base, each variant of `alertVariants` and each part as named rows (`layout`, `columns`, `size`, `color`, `icon`).\n- `ACCESSIBILITY.md`: role, names, contrast per variant and layout decisions, with their measures.\n\n## Architecture\n\n- Layer: `packages/ui`, the bottom of `templates` → `parttens` → `ui` → `utils`. `alert.tsx` imports only `class-variance-authority` and `cn` from `@tc96/utils`.\n- Resolution: `packages/ui/package.json` exports `./alert` as `./src/alert/index.ts`, ahead of the `./*` → `./src/*.tsx` pattern; `tsconfig.base.json` maps `@tc96/ui/*` to `packages/ui/src/*`, which reaches `alert/index.ts` as a folder index.\n- Manifest: the `alert` item of `packages/ui/ui.manifest.json` lists the five files of this folder and the status color tokens (`cssVars`). `check:coss` fails on a file here that the manifest does not list.\n- Scripts: `scripts/check-boundaries.ts` and `packages/registry/src/build-registry.ts` read a manifest path ending in `/index` as the folder module, so `@tc96/ui/alert` resolves to the `alert` item.\n- Consumer: the registry item `ui/alert.json` ships the five files to `<ui alias>/alert/`. A consumer that already has a single `alert.tsx` keeps it, and that file wins over the folder in module resolution.\n- Theme: one rule of the consumer's stylesheet belongs to the alert, `[data-slot=\"alert\"]` redefining `--success` and `--warning` as their `-foreground` (`apps/example/packages/ui/src/styles.css`), shared with `[data-slot=\"toast-icon\"]`; see `ACCESSIBILITY.md`.\n\n## Dependents\n\n- `packages/ui/src/patterns/flow/inspector/composition/flow-inspector/flow-inspector.tsx`: the `unconnected` warning, which sets `[&>svg]:text-warning-foreground` itself so its icon passes without the theme rule.\n- `alert-dialog.tsx` is a separate COSS item (a modal dialog); an edit here does not reach it.\n\n## Invariants\n\n- `TOKENS.md` and `alert.tsx` carry the same classes: the rows of a table, joined, hold exactly the classes of that string. An edit that touches one and not the other is incomplete, and `scripts/ui-tokens.test.ts` fails on it.\n- Every variant keeps the plain 1px `--border`, as the `Card` does; the status shows in the icon and the 4% tint, never in a tinted border (decision of 2026-11-02).\n- The root always renders `role=\"alert\"`. A message that is on screen from the first render passes `role=\"status\"` or no live role through props, which spread after the default.\n- The icon column opens only for an `svg` that is a direct child (`has-[>svg]`); an icon wrapped in another element lands in the text column.\n- The action buttons are the `Button` at `size=\"sm\"`, not the `xs` of the COSS examples (decision of 2026-11-02).\n- From `sm` the action sits in the last column, centered across the title and description rows; below `sm` it drops under the text.\n\n## Styling\n\n- `data-slot`: `alert`, `alert-title`, `alert-description`, `alert-action`. `AlertTitle`, `AlertDescription` and `AlertAction` place themselves against `svg` and `[data-slot=alert-*]` siblings, so a replacement element keeps the slot.\n- `alertVariants` is not exported.\n- A pattern that changes the radius, border or shadow of an `Alert` needs an entry in `scripts/override-exceptions.json`.\n- Contrast is fixed in the theme, never in `alert.tsx`; the rule and its ratios are in `ACCESSIBILITY.md`.\n\n## Verify\n\n```bash\nbun run typecheck && bun run storybook:typecheck\nbun run check:coss && bun run boundaries:check && bun run overrides:check\nbun test scripts/ui-tokens.test.ts # TOKENS.md against the class strings\ncd apps/storybook && bunx vitest run --project=storybook --project=storybook-dark src/ui/alert\n```\n\nAn edit of a class the flow inspector relies on runs `src/patterns/flow` as well.\n\n## Pointers\n\n- `ACCESSIBILITY.md` (this folder): the alert's accessibility decisions and measures.\n- `TOKENS.md` (this folder): the blueprint of every part.\n- Stories: `apps/storybook/src/ui/alert/`; the API text is `api-reference.mdx` there, `alert-layouts.tsx` holds the compositions that `Layouts` shows and `Behavior` tests plus the `ComposedAlert` that `Playground` and `Stories` render, and `alert-controls.ts` holds their args.\n- Decision and history: `docs/architecture/tc96-ui.md` (`Alert em pasta própria em packages/ui`), `.specs/adr/0008-ui-owned-source.md`.\n"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"path": "registry/default/ui/alert/TOKENS.md",
|
|
15
|
+
"content": "# Alert tokens\n\nThe blueprint of the alert and its single source of truth. Every class `alert.tsx` sets is here, once, on the part that carries it. `alertVariants` is a `cva` with a base string and a `variant`; `AlertTitle`, `AlertDescription` and `AlertAction` pass one string each to `cn()`. The rows of a table, joined, hold exactly the classes of that string (the order inside a string does not change the result). `cn()` joins the `cva` output and the consumer's `className` in that order, so the consumer's class wins a conflict. A change to how the alert looks starts here and is then copied into `alert.tsx`.\n\n`Name` says what a row does:\n\n| Name | Meaning |\n| --- | --- |\n| `layout` | display, grid placement, alignment, gaps |\n| `layout:max-sm` | the same, below the `sm` breakpoint |\n| `layout:sm` | the same, from the `sm` breakpoint |\n| `columns` | the grid columns, chosen by which children are present |\n| `size` | width, padding and type size with no condition |\n| `type` | weight |\n| `shape` | radius and border |\n| `color` | theme colors at rest |\n| `dark` | colors in dark mode |\n| `icon` | the leading `svg` child |\n\n## Theme\n\nTokens read: `--card-foreground`, `--muted-foreground`, `--border` (through the base `border-border` rule of the consumer's stylesheet), `--input`, `--destructive`, `--info`, `--success`, `--warning`, `--radius-xl`. The ui manifest ships `--info`, `--success`, `--warning` as `blue-500`, `emerald-500`, `amber-500`, with their `-foreground` pairs as the `700` shade in light and the `400` shade in dark.\n\nRules in the consumer's stylesheet (`apps/example/packages/ui/src/styles.css`), outside `alert.tsx`:\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `[data-slot=\"alert\"] { --success: var(--success-foreground); --warning: var(--warning-foreground) }` | the `success` and `warning` icons and tints read the darker shade; the same rule covers `[data-slot=\"toast-icon\"]` |\n\nWhy the rule exists, with its contrast: `ACCESSIBILITY.md`.\n\n## Parts\n\nThe variants keep the COSS names. Every variant keeps the plain `border` (`--border`), as the `Card` does: the COSS tinted border (`border-<status>/32`) is removed (decision of 2026-11-02), so the status shows only in the icon and the tinted background.\n\n### Alert (`alert`)\n\nA `div` with `role=\"alert\"`. It is a grid: an `svg` as a direct child opens a 16px first column, an `AlertAction` opens a last column, and the title and description take the column between them.\n\n#### Base\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `layout` | `relative grid items-start gap-x-2 gap-y-0.5` | 8px between columns, 2px between the title and the description |\n| `columns` | `has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*4)_1fr_auto] has-[>svg]:gap-x-2` | icon, text and action columns; `has-[>svg]:gap-x-2` repeats the base gap, as COSS ships it |\n| `size` | `w-full px-3.5 py-3 text-sm` | 14px inline, 12px block, 14px text |\n| `shape` | `rounded-xl border` | `--radius-xl`, 1px `--border` |\n| `color` | `text-card-foreground` | the title color; the description sets its own |\n| `icon` | `[&>svg]:h-lh [&>svg]:w-4` | 16px wide and one line tall, so it sits on the title's first line |\n\n#### Variant `default`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-transparent` | |\n| `dark` | `dark:bg-input/32` | |\n| `icon` | `[&>svg]:text-muted-foreground` | |\n\n#### Variant `error`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-destructive/4` | |\n| `icon` | `[&>svg]:text-destructive` | |\n\n#### Variant `info`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-info/4` | |\n| `icon` | `[&>svg]:text-info` | |\n\n#### Variant `success`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-success/4` | `--success` is `--success-foreground` inside the alert (theme rule) |\n| `icon` | `[&>svg]:text-success` | |\n\n#### Variant `warning`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-warning/4` | `--warning` is `--warning-foreground` inside the alert (theme rule) |\n| `icon` | `[&>svg]:text-warning` | |\n\n### AlertTitle (`alert-title`)\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `layout` | `[svg~&]:col-start-2` | after an icon, the text column |\n| `type` | `font-medium` | |\n\n### AlertDescription (`alert-description`)\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `layout` | `flex flex-col gap-2.5 [svg~&]:col-start-2` | stacks paragraphs 10px apart; after an icon, the text column |\n| `color` | `text-muted-foreground` | |\n\n### AlertAction (`alert-action`)\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `layout` | `flex gap-1` | buttons 4px apart |\n| `layout:max-sm` | `max-sm:col-start-2 max-sm:mt-2` | below 640px, a row under the text, 8px down |\n| `layout:sm` | `sm:row-start-1 sm:row-end-3 sm:self-center sm:[[data-slot=alert-title]~&]:col-start-2 sm:[[data-slot=alert-description]~&]:col-start-2 sm:[svg~&]:col-start-2 sm:[svg~[data-slot=alert-title]~&]:col-start-3 sm:[svg~[data-slot=alert-description]~&]:col-start-3` | from 640px, the last column, centered across the title and description rows |\n"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"path": "registry/default/ui/alert/alert.tsx",
|
|
19
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\nimport { cn } from \"@tc96/utils\";\n\nconst alertVariants = cva(\n \"relative grid w-full items-start gap-x-2 gap-y-0.5 rounded-xl border px-3.5 py-3 text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*4)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-2 [&>svg]:h-lh [&>svg]:w-4\",\n {\n defaultVariants: {\n variant: \"default\",\n },\n variants: {\n variant: {\n default:\n \"bg-transparent dark:bg-input/32 [&>svg]:text-muted-foreground\",\n error: \"bg-destructive/4 [&>svg]:text-destructive\",\n info: \"bg-info/4 [&>svg]:text-info\",\n success: \"bg-success/4 [&>svg]:text-success\",\n warning: \"bg-warning/4 [&>svg]:text-warning\",\n },\n },\n },\n);\n\nexport function Alert({\n className,\n variant,\n ...props\n}: React.ComponentProps<\"div\"> &\n VariantProps<typeof alertVariants>): React.ReactElement {\n return (\n <div\n className={cn(alertVariants({ variant }), className)}\n data-slot=\"alert\"\n role=\"alert\"\n {...props}\n />\n );\n}\n\nexport function AlertTitle({\n className,\n ...props\n}: React.ComponentProps<\"div\">): React.ReactElement {\n return (\n <div\n className={cn(\"font-medium [svg~&]:col-start-2\", className)}\n data-slot=\"alert-title\"\n {...props}\n />\n );\n}\n\nexport function AlertDescription({\n className,\n ...props\n}: React.ComponentProps<\"div\">): React.ReactElement {\n return (\n <div\n className={cn(\n \"flex flex-col gap-2.5 text-muted-foreground [svg~&]:col-start-2\",\n className,\n )}\n data-slot=\"alert-description\"\n {...props}\n />\n );\n}\n\nexport function AlertAction({\n className,\n ...props\n}: React.ComponentProps<\"div\">): React.ReactElement {\n return (\n <div\n className={cn(\n \"flex gap-1 max-sm:col-start-2 max-sm:mt-2 sm:row-start-1 sm:row-end-3 sm:self-center sm:[[data-slot=alert-description]~&]:col-start-2 sm:[[data-slot=alert-title]~&]:col-start-2 sm:[svg~&]:col-start-2 sm:[svg~[data-slot=alert-description]~&]:col-start-3 sm:[svg~[data-slot=alert-title]~&]:col-start-3\",\n className,\n )}\n data-slot=\"alert-action\"\n {...props}\n />\n );\n}\n"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "registry/default/ui/alert/index.ts",
|
|
23
|
+
"content": "export * from \"./alert\";\n"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"dependencies": [
|
|
27
|
+
"class-variance-authority@0.7.1"
|
|
28
|
+
],
|
|
29
|
+
"registryDependencies": [],
|
|
30
|
+
"cssVars": {
|
|
31
|
+
"light": {
|
|
32
|
+
"destructive-foreground": "var(--color-red-700)",
|
|
33
|
+
"info": "var(--color-blue-500)",
|
|
34
|
+
"info-foreground": "var(--color-blue-700)",
|
|
35
|
+
"success": "var(--color-emerald-500)",
|
|
36
|
+
"success-foreground": "var(--color-emerald-700)",
|
|
37
|
+
"warning": "var(--color-amber-500)",
|
|
38
|
+
"warning-foreground": "var(--color-amber-700)"
|
|
39
|
+
},
|
|
40
|
+
"dark": {
|
|
41
|
+
"destructive-foreground": "var(--color-red-400)",
|
|
42
|
+
"info": "var(--color-blue-500)",
|
|
43
|
+
"info-foreground": "var(--color-blue-400)",
|
|
44
|
+
"success": "var(--color-emerald-500)",
|
|
45
|
+
"success-foreground": "var(--color-emerald-400)",
|
|
46
|
+
"warning": "var(--color-amber-500)",
|
|
47
|
+
"warning-foreground": "var(--color-amber-400)"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "autocomplete",
|
|
3
|
+
"type": "registry:ui",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"path": "registry/default/ui/autocomplete.tsx",
|
|
7
|
+
"content": "\"use client\";\n\nimport { Autocomplete as AutocompletePrimitive } from \"@base-ui/react/autocomplete\";\nimport { CaretUpDownIcon, XIcon } from \"@phosphor-icons/react\";\nimport type React from \"react\";\nimport { cn } from \"@tc96/utils\";\nimport { Input } from \"@tc96/ui/input\";\nimport { ScrollArea } from \"@tc96/ui/scroll-area\";\n\nexport const Autocomplete: typeof AutocompletePrimitive.Root =\n AutocompletePrimitive.Root;\n\nexport function AutocompleteInput({\n className,\n showTrigger = false,\n showClear = false,\n startAddon,\n size,\n triggerProps,\n clearProps,\n ...props\n}: Omit<AutocompletePrimitive.Input.Props, \"size\"> & {\n showTrigger?: boolean;\n showClear?: boolean;\n startAddon?: React.ReactNode;\n size?: \"sm\" | \"default\" | \"lg\" | number;\n ref?: React.Ref<HTMLInputElement>;\n triggerProps?: AutocompletePrimitive.Trigger.Props;\n clearProps?: AutocompletePrimitive.Clear.Props;\n}): React.ReactElement {\n const sizeValue = (size ?? \"default\") as \"sm\" | \"default\" | \"lg\" | number;\n\n return (\n <AutocompletePrimitive.InputGroup\n className=\"relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64\"\n data-slot=\"autocomplete-input-group\"\n >\n {startAddon && (\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:-mx-0.5\"\n data-slot=\"autocomplete-start-addon\"\n >\n {startAddon}\n </div>\n )}\n <AutocompletePrimitive.Input\n className={cn(\n startAddon &&\n \"data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=autocomplete-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(8)-1px)]\",\n sizeValue === \"sm\"\n ? \"has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-6.5\"\n : \"has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-7\",\n className,\n )}\n data-slot=\"autocomplete-input\"\n render={<Input nativeInput size={sizeValue} />}\n {...props}\n />\n {showTrigger && (\n <AutocompleteTrigger\n className={cn(\n \"absolute top-1/2 inline-flex size-8 shrink-0 -translate-y-1/2 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n sizeValue === \"sm\" ? \"end-0\" : \"end-0.5\",\n )}\n {...triggerProps}\n >\n <AutocompletePrimitive.Icon aria-hidden=\"true\" data-slot=\"autocomplete-icon\">\n <CaretUpDownIcon aria-hidden=\"true\" />\n </AutocompletePrimitive.Icon>\n </AutocompleteTrigger>\n )}\n {showClear && (\n <AutocompleteClear\n className={cn(\n \"absolute top-1/2 inline-flex size-8 shrink-0 -translate-y-1/2 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n sizeValue === \"sm\" ? \"end-0\" : \"end-0.5\",\n )}\n {...clearProps}\n >\n <XIcon aria-hidden=\"true\" />\n </AutocompleteClear>\n )}\n </AutocompletePrimitive.InputGroup>\n );\n}\n\nexport function AutocompletePopup({\n className,\n children,\n side = \"bottom\",\n sideOffset = 4,\n alignOffset,\n align = \"start\",\n anchor,\n portalProps,\n ...props\n}: AutocompletePrimitive.Popup.Props & {\n align?: AutocompletePrimitive.Positioner.Props[\"align\"];\n sideOffset?: AutocompletePrimitive.Positioner.Props[\"sideOffset\"];\n alignOffset?: AutocompletePrimitive.Positioner.Props[\"alignOffset\"];\n side?: AutocompletePrimitive.Positioner.Props[\"side\"];\n anchor?: AutocompletePrimitive.Positioner.Props[\"anchor\"];\n portalProps?: AutocompletePrimitive.Portal.Props;\n}): React.ReactElement {\n return (\n <AutocompletePrimitive.Portal {...portalProps}>\n <AutocompletePrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"z-50 select-none\"\n data-slot=\"autocomplete-positioner\"\n side={side}\n sideOffset={sideOffset}\n >\n <span\n className={cn(\n \"relative flex max-h-full min-w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding shadow-lg/5 transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]\",\n className,\n )}\n >\n <AutocompletePrimitive.Popup\n className=\"flex max-h-[min(var(--available-height),23rem)] flex-1 flex-col text-foreground\"\n data-slot=\"autocomplete-popup\"\n {...props}\n >\n {children}\n </AutocompletePrimitive.Popup>\n </span>\n </AutocompletePrimitive.Positioner>\n </AutocompletePrimitive.Portal>\n );\n}\n\nexport function AutocompleteItem({\n className,\n children,\n ...props\n}: AutocompletePrimitive.Item.Props): React.ReactElement {\n return (\n <AutocompletePrimitive.Item\n className={cn(\n \"flex min-h-8 cursor-default select-none items-center rounded-sm px-2 py-1 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm\",\n className,\n )}\n data-slot=\"autocomplete-item\"\n {...props}\n >\n {children}\n </AutocompletePrimitive.Item>\n );\n}\n\nexport function AutocompleteSeparator({\n className,\n ...props\n}: AutocompletePrimitive.Separator.Props): React.ReactElement {\n return (\n <AutocompletePrimitive.Separator\n className={cn(\"mx-2 my-1 h-px bg-border last:hidden\", className)}\n data-slot=\"autocomplete-separator\"\n {...props}\n />\n );\n}\n\nexport function AutocompleteGroup({\n className,\n ...props\n}: AutocompletePrimitive.Group.Props): React.ReactElement {\n return (\n <AutocompletePrimitive.Group\n className={cn(\"[[role=group]+&]:mt-1.5\", className)}\n data-slot=\"autocomplete-group\"\n {...props}\n />\n );\n}\n\nexport function AutocompleteGroupLabel({\n className,\n ...props\n}: AutocompletePrimitive.GroupLabel.Props): React.ReactElement {\n return (\n <AutocompletePrimitive.GroupLabel\n className={cn(\n \"px-2 py-1.5 font-medium text-muted-foreground text-xs\",\n className,\n )}\n data-slot=\"autocomplete-group-label\"\n {...props}\n />\n );\n}\n\nexport function AutocompleteEmpty({\n className,\n ...props\n}: AutocompletePrimitive.Empty.Props): React.ReactElement {\n return (\n <AutocompletePrimitive.Empty\n className={cn(\n \"not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm\",\n className,\n )}\n data-slot=\"autocomplete-empty\"\n {...props}\n />\n );\n}\n\nexport function AutocompleteRow({\n className,\n ...props\n}: AutocompletePrimitive.Row.Props): React.ReactElement {\n return (\n <AutocompletePrimitive.Row\n className={className}\n data-slot=\"autocomplete-row\"\n {...props}\n />\n );\n}\n\nexport const AutocompleteValue: typeof AutocompletePrimitive.Value =\n AutocompletePrimitive.Value;\n\nexport function AutocompleteList({\n className,\n ...props\n}: AutocompletePrimitive.List.Props): React.ReactElement {\n return (\n <ScrollArea overscrollContain scrollbarGutter scrollFade>\n <AutocompletePrimitive.List\n className={cn(\n \"not-empty:scroll-py-1 not-empty:p-1 in-data-has-overflow-y:pe-3\",\n className,\n )}\n data-slot=\"autocomplete-list\"\n {...props}\n />\n </ScrollArea>\n );\n}\n\nexport function AutocompleteClear({\n className,\n ...props\n}: AutocompletePrimitive.Clear.Props): React.ReactElement {\n return (\n <AutocompletePrimitive.Clear\n className={cn(\n \"absolute end-0.5 top-1/2 inline-flex size-8 shrink-0 -translate-y-1/2 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-[color,background-color,box-shadow,opacity] pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className,\n )}\n data-slot=\"autocomplete-clear\"\n {...props}\n >\n <XIcon aria-hidden=\"true\" />\n </AutocompletePrimitive.Clear>\n );\n}\n\nexport function AutocompleteStatus({\n className,\n ...props\n}: AutocompletePrimitive.Status.Props): React.ReactElement {\n return (\n <AutocompletePrimitive.Status\n className={cn(\n \"px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0\",\n className,\n )}\n data-slot=\"autocomplete-status\"\n {...props}\n />\n );\n}\n\nexport const AutocompleteCollection: typeof AutocompletePrimitive.Collection =\n AutocompletePrimitive.Collection;\n\nexport function AutocompleteTrigger({\n className,\n children,\n ...props\n}: AutocompletePrimitive.Trigger.Props): React.ReactElement {\n return (\n <AutocompletePrimitive.Trigger\n className={className}\n data-slot=\"autocomplete-trigger\"\n {...props}\n >\n {children}\n </AutocompletePrimitive.Trigger>\n );\n}\n\nexport const useAutocompleteFilter: typeof AutocompletePrimitive.useFilter =\n AutocompletePrimitive.useFilter;\n\nexport { AutocompletePrimitive };\n"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"dependencies": [
|
|
11
|
+
"@base-ui/react@1.8.0",
|
|
12
|
+
"@phosphor-icons/react@2.1.10"
|
|
13
|
+
],
|
|
14
|
+
"registryDependencies": [
|
|
15
|
+
"@ui/input",
|
|
16
|
+
"@ui/scroll-area"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "avatar",
|
|
3
|
+
"type": "registry:ui",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"path": "registry/default/ui/avatar.tsx",
|
|
7
|
+
"content": "\"use client\";\n\nimport { Avatar as AvatarPrimitive } from \"@base-ui/react/avatar\";\nimport type React from \"react\";\nimport { cn } from \"@tc96/utils\";\n\nconst AVATAR_GROUP_CUT =\n \"url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/svg%3E\\\")\";\n\nexport function Avatar({\n className,\n ...props\n}: AvatarPrimitive.Root.Props): React.ReactElement {\n return (\n <AvatarPrimitive.Root\n className={cn(\n \"relative isolate inline-flex size-(--avatar-size,--spacing(8)) shrink-0 select-none items-center justify-center overflow-hidden rounded-full align-middle font-medium text-[calc(var(--avatar-size,--spacing(8))*0.375)]/none\",\n className,\n )}\n data-slot=\"avatar\"\n {...props}\n />\n );\n}\n\nexport function AvatarImage({\n className,\n ...props\n}: AvatarPrimitive.Image.Props): React.ReactElement {\n return (\n <AvatarPrimitive.Image\n className={cn(\n \"absolute inset-0 z-10 size-full rounded-[inherit] object-cover data-error:invisible data-loading:invisible\",\n className,\n )}\n data-slot=\"avatar-image\"\n {...props}\n />\n );\n}\n\nexport function AvatarFallback({\n className,\n ...props\n}: AvatarPrimitive.Fallback.Props): React.ReactElement {\n return (\n <AvatarPrimitive.Fallback\n className={cn(\n \"absolute inset-0 flex size-full items-center justify-center rounded-[inherit] bg-border\",\n className,\n )}\n data-slot=\"avatar-fallback\"\n {...props}\n />\n );\n}\n\nexport interface AvatarGroupProps extends React.ComponentProps<\"div\"> {\n topmost?: \"first\" | \"last\";\n}\n\nexport function AvatarGroup({\n className,\n style,\n topmost = \"first\",\n ...props\n}: AvatarGroupProps): React.ReactElement {\n return (\n <div\n className={cn(\n \"flex w-fit items-center\",\n \"[--avatar-group-size:var(--avatar-size,--spacing(8))]\",\n \"[--avatar-group-gap:var(--avatar-gap,calc(var(--avatar-group-size)/16))]\",\n \"[--avatar-group-overlap:var(--avatar-overlap,calc(var(--avatar-group-size)*0.3))]\",\n \"[--avatar-group-cut-end:calc(var(--avatar-group-size)*1.5-var(--avatar-group-overlap))]\",\n \"[--avatar-group-cut-radius:calc(var(--avatar-group-size)/2+var(--avatar-group-gap))]\",\n \"[--avatar-group-cut-start:calc(var(--avatar-group-overlap)-var(--avatar-group-size)/2)]\",\n \"[--avatar-group-mask-position:0_0,calc(var(--avatar-group-cut-x)-var(--avatar-group-cut-radius))_50%]\",\n \"[--avatar-group-mask-size:100%_100%,calc(var(--avatar-group-cut-radius)*2)_calc(var(--avatar-group-cut-radius)*2)]\",\n \"[--avatar-group-mask:none]\",\n \"supports-[mask-composite:subtract]:[--avatar-group-mask:var(--avatar-group-cut-image),var(--avatar-group-cut-image)]\",\n \"[--avatar-group-nudge:var(--avatar-nudge,calc((var(--avatar-group-overlap)+var(--avatar-group-gap))*0.3))]\",\n \"*:not-first:-ms-(--avatar-group-overlap)\",\n topmost === \"first\"\n ? \"*:not-first:mask-(--avatar-group-mask) *:not-first:mask-subtract *:not-first:mask-position-(--avatar-group-mask-position) *:not-first:mask-no-repeat *:not-first:mask-size-(--avatar-group-mask-size) [--avatar-group-cut-x:var(--avatar-group-cut-start)] *:not-first:*:data-[slot=avatar-fallback]:ps-[calc(var(--avatar-group-nudge)*2)] supports-[mask-composite:subtract]:*:not-first:rounded-none rtl:[--avatar-group-cut-x:var(--avatar-group-cut-end)]\"\n : \"*:not-last:mask-(--avatar-group-mask) *:not-last:mask-subtract *:not-last:mask-position-(--avatar-group-mask-position) *:not-last:mask-no-repeat *:not-last:mask-size-(--avatar-group-mask-size) [--avatar-group-cut-x:var(--avatar-group-cut-end)] *:not-last:*:data-[slot=avatar-fallback]:pe-[calc(var(--avatar-group-nudge)*2)] supports-[mask-composite:subtract]:*:not-last:rounded-none rtl:[--avatar-group-cut-x:var(--avatar-group-cut-start)]\",\n className,\n )}\n data-slot=\"avatar-group\"\n data-topmost={topmost}\n style={\n {\n \"--avatar-group-cut-image\": AVATAR_GROUP_CUT,\n ...style,\n } as React.CSSProperties\n }\n {...props}\n />\n );\n}\n\nexport function AvatarGroupCount({\n children,\n className,\n ...props\n}: AvatarPrimitive.Root.Props): React.ReactElement {\n return (\n <Avatar\n className={cn(\"text-muted-foreground\", className)}\n data-slot=\"avatar-group-count\"\n {...props}\n >\n <AvatarFallback>{children}</AvatarFallback>\n </Avatar>\n );\n}\n\nexport { AvatarPrimitive };\n"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"dependencies": [
|
|
11
|
+
"@base-ui/react@1.8.0"
|
|
12
|
+
],
|
|
13
|
+
"registryDependencies": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "badge",
|
|
3
|
+
"type": "registry:ui",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"path": "registry/default/ui/badge/ACCESSIBILITY.md",
|
|
7
|
+
"content": "# Badge accessibility\n\nLocal accessibility and usability decisions for the badge. The repo-wide rules (WCAG thresholds, contrast fixed without changing token values, axe in every story) are in `docs/accessibility.md`; this file holds what applies only to the badge. Measured on 2026-11-20 in `UI/Badge/Behavior/Variants` (now `UI/Badge/Behavior/Every Variant`), `Default` theme preset, text over the badge background composed on the page `background`.\n\n## Roles and names\n\n- A badge is a `span` with no role: its text is read inline with what it sits next to. It is not a live region; a count that changes while the user reads needs its own announcement.\n- An icon before the text is decorative and takes `aria-hidden=\"true\"`.\n- A count or a single symbol says nothing alone. Put the meaning in the name of what owns it (`<Button aria-label=\"Notifications, 3 unread\">`) and hide the badge with `aria-hidden`, or give the badge its own `aria-label` (`7 unread messages`).\n- Rendered as a link or a button through `render`, the badge takes that element's role and its name from its text.\n\n## Keyboard and focus\n\n- A `span` badge is not focusable. A link or button badge is, and shows a 2px `--ring` ring with a 1px `--background` offset on `:focus-visible` (`--ring` measures 4.53:1 on `background` in light, recorded in `docs/accessibility.md`, `record-preview`).\n\n## Contrast\n\n| Variant | Light | Dark |\n| --- | --- | --- |\n| `primary` | 14.52:1 | 13.90:1 |\n| `secondary` | 13.30:1 | 14.49:1 |\n| `outline` | 14.52:1 | 15.02:1 |\n| `destructive` (white on `--destructive`) | 4.77:1 | 4.77:1 |\n| `error` | 5.34:1 | 5.55:1 |\n| `info` | 5.96:1 | 5.52:1 |\n| `success` | 4.77:1 | 7.04:1 |\n| `warning` | 4.53:1 | 7.53:1 |\n\nEvery pair passes 4.5:1 on the page `background`. `warning` in light is 0.03 above the line, and the `text-xs` warning badges of the CRM widgets measure 4.36:1 (an axe exception in `docs/accessibility.md`). The tinted variants (`error`, `info`, `success`, `warning`) are measured on `background`; on another surface, measure again. Color never carries the status alone: the badge text names it.\n\n## Pointer and touch\n\n- Rendered as a `button` or an `a`, the badge gets a pointer cursor, a hover color and, with a coarse pointer, a 44px hit area from an `::after` that does not change its look. A `span` badge has none of these.\n- Two fixed sizes at every width: `default` is 20px tall with 12px text, `large` 24px with 14px text. The COSS `sm` size, with 10px text, is removed: no badge text goes under 12px.\n\n## Verified by\n\nThe plays in `apps/storybook/src/ui/badge/` check the element (`span`, link, button), the `aria-hidden` icon, the size order, the round count and the focus ring of a link badge; axe runs on every story in the `storybook` and `storybook-dark` projects.\n"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"path": "registry/default/ui/badge/AGENTS.md",
|
|
11
|
+
"content": "# Badge\n\nA badge is a short label that sits next to the thing it describes: the status of a record, the stage of a deal, a count of unread items, the plan of a workspace. It reads as part of the surrounding text, holds a few words or a number, and can carry a small icon before the text. It is a `span` by default and becomes a link or a button when it has to be clicked, for example a filter chip or a \"New\" label that opens the changelog.\n\nThe component comes from COSS, built on the Base UI `useRender` hook, and is owned by this repo (ADR 0008): every change to how it looks starts in `TOKENS.md`, the blueprint, and is then copied into `badge.tsx`; a pattern never recreates or wraps the badge to restyle it (decision of 2026-11-19). The Storybook node `UI/Badge` documents it in six pages: `API Reference` (MDX: import, anatomy, the contract of `Badge` and `badgeVariants`), `Playground` (text, variant, size, icon and element as controls), `Stories` (one story per variant, per non-default size and per element on the text-only base, with those props fixed and the text and icon as controls), `Behavior` (one `play` per guarantee), `Usages` (badges in context) and `Layouts` (the base with an icon); `Get Started/Component Docs` sets that structure.\n\n## Map\n\n- `badge.tsx`: `Badge`, `BadgeProps` and `badgeVariants`.\n- `index.ts`: the barrel `@tc96/ui/badge` resolves to.\n- `TOKENS.md`: the blueprint and single source of truth of the look: the base, the two sizes and each variant of `badgeVariants` as named rows (`layout`, `size`, `size:sm`, `color`, `dark`, `hover`).\n- `ACCESSIBILITY.md`: roles, names, focus, contrast per variant and touch decisions, with their measures.\n\n## Architecture\n\n- Layer: `packages/ui`, the bottom of `templates` → `parttens` → `ui` → `utils`. `badge.tsx` imports only Base UI (`useRender`, `mergeProps`), `class-variance-authority` and `cn` from `@tc96/utils`.\n- Resolution: `packages/ui/package.json` exports `./badge` as `./src/badge/index.ts`, ahead of the `./*` → `./src/*.tsx` pattern; `tsconfig.base.json` maps `@tc96/ui/*` to `packages/ui/src/*`, which reaches `badge/index.ts` as a folder index.\n- Manifest: the `badge` item of `packages/ui/ui.manifest.json` lists the five files of this folder and the status color tokens (`cssVars`). `check:coss` fails on a file here that the manifest does not list.\n- Scripts: `scripts/check-boundaries.ts` and `packages/registry/src/build-registry.ts` read a manifest path ending in `/index` as the folder module, so `@tc96/ui/badge` resolves to the `badge` item.\n- Consumer: the registry item `ui/badge.json` ships the five files to `<ui alias>/badge/`. A consumer that already has a single `badge.tsx` keeps it, and that file wins over the folder in module resolution.\n- Theme: no rule of the consumer's stylesheet targets the badge; the status pairs come from the manifest tokens.\n\n## Dependents\n\n- `packages/ui/src/patterns`: `collection` (data-grid, kanban and list layouts, shared components), `properties/shared` (`PropertySurface` chips), `records/group` (`RecordStatusBadge`), `widgets` (crm, gamification, productivity, shared), `flow` (canvas, inspector, step library), `chat` (assistant panel, chats panel item).\n- `packages/ui/src/blocks/application/shell/shared`.\n- `sidebar.tsx` has its own `SidebarMenuBadge`; an edit here does not reach it.\n- `RecordStatusBadge` and the `PropertySurface` chips build on `Badge` with their own classes; read `records/group/AGENTS.md` and `properties/AGENTS.md` before changing the radius, height or padding here.\n\n## Invariants\n\n- `TOKENS.md` and `badge.tsx` carry the same classes: the rows of a table, joined, hold exactly the classes of that `cva` string. An edit that touches one and not the other is incomplete, and `scripts/ui-tokens.test.ts` fails on it.\n- Every variant keeps a 1px border (`border-transparent` in the base), so badges of different variants line up at the same height.\n- The hover color, the pointer cursor and the 44px coarse hit area apply only when the badge renders as a `button` or an `a` (`[button&,a&]`); a `span` badge never looks clickable.\n- The filled variant on `--primary` is named `primary`, not the COSS `default`, and is the default variant (decision of 2026-11-20); `DataGridColumnMeta.badgeVariant` uses the same names.\n- Two sizes only, `default` and `large` (the COSS `lg`), with two heights: 20px and 24px at every width. No class of a size changes at a breakpoint, so height, text (12px, 14px) and icon (12px, 14px) stay fixed (decision of 2026-11-20). The COSS `sm` (10px text) is removed and must not come back. A count on an icon button uses `default`.\n- A count badge is round through the consumer's `className=\"rounded-full\"`; `min-w-*` equal to `h-*` in every size keeps a one-digit count a circle.\n\n## Styling\n\n- `data-slot`: `badge`.\n- `badgeVariants` is exported, so a pattern can give another element the badge look (`badgeVariants({ variant: 'outline' })`); prefer `render` when the element can be passed.\n- A pattern that changes the radius, border or shadow of a `Badge` needs an entry in `scripts/override-exceptions.json`.\n\n## Verify\n\n```bash\nbun run typecheck && bun run storybook:typecheck\nbun run check:coss && bun run boundaries:check && bun run overrides:check\nbun test scripts/ui-tokens.test.ts # TOKENS.md against the class strings\ncd apps/storybook && bunx vitest run --project=storybook --project=storybook-dark src/ui/badge\n```\n\nAn edit of a class a pattern or template relies on runs the whole Storybook suite.\n\n## Pointers\n\n- `ACCESSIBILITY.md` (this folder): the badge's accessibility decisions and measures.\n- `TOKENS.md` (this folder): the blueprint of the base, sizes and variants.\n- Stories: `apps/storybook/src/ui/badge/`; the API text is `api-reference.mdx` there, and the value lists, Playground controls and shared compositions are `badge-variants.ts`, `badge-controls.ts` and `badge-layouts.tsx`.\n- Decision and history: `docs/architecture/tc96-ui.md` (`Badge em pasta própria em packages/ui`), `.specs/adr/0008-ui-owned-source.md`.\n"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"path": "registry/default/ui/badge/TOKENS.md",
|
|
15
|
+
"content": "# Badge tokens\n\nThe blueprint of the badge and its single source of truth. `badgeVariants` (`badge.tsx`) is a `cva` with a base string, a `variant` and a `size`; every class it sets is here, once. The rows of a table, joined, hold exactly the classes of that string. `cn()` joins base, variant, size and the consumer's `className` in that order, so a later string wins a conflict. A change to how the badge looks starts here and is then copied into `badge.tsx`.\n\n`Name` says what a row does:\n\n| Name | Meaning |\n| --- | --- |\n| `layout` | display, alignment, gaps |\n| `size` | height, minimum width, padding and type size with no condition |\n| `size:coarse` | the hit area with a coarse pointer |\n| `type` | weight |\n| `shape` | radius and border |\n| `color` | theme colors at rest |\n| `dark` | colors in dark mode |\n| `hover` | hover color, only when rendered as a `button` or an `a` |\n| `interactive` | rules that apply only to a `button` or an `a` |\n| `disabled` | the `disabled` attribute |\n| `focus` | outline and ring |\n| `icon` | an `svg` child |\n| `motion` | transitions |\n\n## Theme\n\nTokens read: `--primary`, `--primary-foreground`, `--secondary`, `--secondary-foreground`, `--destructive`, `--destructive-foreground`, `--info`, `--info-foreground`, `--success`, `--success-foreground`, `--warning`, `--warning-foreground`, `--input`, `--background`, `--foreground`, `--accent`, `--ring`, `--radius-sm`. The ui manifest ships the status pairs: `--info`, `--success`, `--warning` as `blue-500`, `emerald-500`, `amber-500`; their `-foreground` as the `700` shade in light and the `400` shade in dark; `--destructive-foreground` as `red-700` and `red-400`.\n\nNo rule in the consumer's stylesheet targets the badge.\n\n## Parts\n\nThe variant COSS calls `default` is `primary` here, and the size COSS calls `lg` is `large` (decisions of 2026-11-20); `primary` and `default` are the defaults. A badge has two heights and no breakpoint variation: `default` is 20px and `large` 24px at every width, with their text and icon fixed as well; COSS changed height, text and icon at `sm`.\n\nCOSS ships a third size, `sm` (16px tall and 10px text from `sm`); this workspace removed it (decision of 2026-11-20), so a badge is at least 18px tall with 12px text.\n\n\nOne part: `Badge` (`badge`), a `span` through Base UI `useRender`, or the element passed in `render`. It carries `data-slot=\"badge\"` and no other `data-*`.\n\n### Base\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `layout` | `relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap` | icon and text on one line, never wrapped |\n| `shape` | `rounded-sm border border-transparent` | the border keeps every variant the same size as `outline` |\n| `type` | `font-medium` | |\n| `focus` | `outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background` | ring when rendered as a focusable element |\n| `motion` | `transition-shadow` | |\n| `disabled` | `disabled:pointer-events-none disabled:opacity-64` | |\n| `icon` | `[&_svg:not([class*='size-'])]:size-3 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg]:pointer-events-none [&_svg]:shrink-0` | 12px, at 80%; `large` raises it to 14px |\n| `interactive` | `[button&,a&]:cursor-pointer` | |\n| `size:coarse` | `[button&,a&]:pointer-coarse:after:absolute [button&,a&]:pointer-coarse:after:size-full [button&,a&]:pointer-coarse:after:min-h-11 [button&,a&]:pointer-coarse:after:min-w-11` | a 44px hit area around a `button` or `a`, without changing its look |\n\n### Size `default`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `size` | `h-5 min-w-5 px-1 text-xs` | 20px tall, 12px text, 4px between the label and the edge |\n\n### Size `large`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `size` | `h-6 min-w-6 px-1.5 text-sm` | 24px tall, 14px text, 6px between the label and the edge |\n| `icon` | `[&_svg:not([class*='size-'])]:size-3.5` | 14px icon, wins over the base 12px in `cn()` |\n\n### Variant `primary`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-primary text-primary-foreground` | |\n| `hover` | `[button&,a&]:hover:bg-primary/90` | |\n\n### Variant `secondary`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-secondary text-secondary-foreground` | |\n| `hover` | `[button&,a&]:hover:bg-secondary/90` | |\n\n### Variant `outline`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `shape` | `border-input` | |\n| `color` | `bg-background text-foreground` | |\n| `dark` | `dark:bg-input/32` | |\n| `hover` | `[button&,a&]:hover:bg-accent/50 dark:[button&,a&]:hover:bg-input/48` | |\n\n### Variant `destructive`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-destructive text-white` | |\n| `hover` | `[button&,a&]:hover:bg-destructive/90` | |\n\n### Variant `error`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-destructive/8 text-destructive-foreground` | tinted background, strong text |\n| `dark` | `dark:bg-destructive/16` | |\n\n### Variant `info`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-info/8 text-info-foreground` | |\n| `dark` | `dark:bg-info/16` | |\n\n### Variant `success`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-success/8 text-success-foreground` | |\n| `dark` | `dark:bg-success/16` | |\n\n### Variant `warning`\n\n| Name | Selectors | Description |\n| --- | --- | --- |\n| `color` | `bg-warning/8 text-warning-foreground` | |\n| `dark` | `dark:bg-warning/16` | |\n"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"path": "registry/default/ui/badge/badge.tsx",
|
|
19
|
+
"content": "\"use client\";\n\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type React from \"react\";\nimport { cn } from \"@tc96/utils\";\n\nexport const badgeVariants = cva(\n \"relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button&,a&]:cursor-pointer [button&,a&]:pointer-coarse:after:absolute [button&,a&]:pointer-coarse:after:size-full [button&,a&]:pointer-coarse:after:min-h-11 [button&,a&]:pointer-coarse:after:min-w-11\",\n {\n defaultVariants: {\n size: \"default\",\n variant: \"primary\",\n },\n variants: {\n size: {\n default: \"h-5 min-w-5 px-1 text-xs\",\n large:\n \"h-6 min-w-6 px-1.5 text-sm [&_svg:not([class*='size-'])]:size-3.5\",\n },\n variant: {\n primary:\n \"bg-primary text-primary-foreground [button&,a&]:hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white [button&,a&]:hover:bg-destructive/90\",\n error:\n \"bg-destructive/8 text-destructive-foreground dark:bg-destructive/16\",\n info: \"bg-info/8 text-info-foreground dark:bg-info/16\",\n outline:\n \"border-input bg-background text-foreground dark:bg-input/32 [button&,a&]:hover:bg-accent/50 dark:[button&,a&]:hover:bg-input/48\",\n secondary:\n \"bg-secondary text-secondary-foreground [button&,a&]:hover:bg-secondary/90\",\n success: \"bg-success/8 text-success-foreground dark:bg-success/16\",\n warning: \"bg-warning/8 text-warning-foreground dark:bg-warning/16\",\n },\n },\n },\n);\n\nexport interface BadgeProps extends useRender.ComponentProps<\"span\"> {\n variant?: VariantProps<typeof badgeVariants>[\"variant\"];\n size?: VariantProps<typeof badgeVariants>[\"size\"];\n}\n\nexport function Badge({\n className,\n variant,\n size,\n render,\n ...props\n}: BadgeProps): React.ReactElement {\n const defaultProps = {\n className: cn(badgeVariants({ className, size, variant })),\n \"data-slot\": \"badge\",\n };\n\n return useRender({\n defaultTagName: \"span\",\n props: mergeProps<\"span\">(defaultProps, props),\n render,\n });\n}\n"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "registry/default/ui/badge/index.ts",
|
|
23
|
+
"content": "export * from \"./badge\";\n"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"dependencies": [
|
|
27
|
+
"@base-ui/react@1.8.0",
|
|
28
|
+
"class-variance-authority@0.7.1"
|
|
29
|
+
],
|
|
30
|
+
"registryDependencies": [],
|
|
31
|
+
"cssVars": {
|
|
32
|
+
"light": {
|
|
33
|
+
"destructive-foreground": "var(--color-red-700)",
|
|
34
|
+
"info": "var(--color-blue-500)",
|
|
35
|
+
"info-foreground": "var(--color-blue-700)",
|
|
36
|
+
"success": "var(--color-emerald-500)",
|
|
37
|
+
"success-foreground": "var(--color-emerald-700)",
|
|
38
|
+
"warning": "var(--color-amber-500)",
|
|
39
|
+
"warning-foreground": "var(--color-amber-700)"
|
|
40
|
+
},
|
|
41
|
+
"dark": {
|
|
42
|
+
"destructive-foreground": "var(--color-red-400)",
|
|
43
|
+
"info": "var(--color-blue-500)",
|
|
44
|
+
"info-foreground": "var(--color-blue-400)",
|
|
45
|
+
"success": "var(--color-emerald-500)",
|
|
46
|
+
"success-foreground": "var(--color-emerald-400)",
|
|
47
|
+
"warning": "var(--color-amber-500)",
|
|
48
|
+
"warning-foreground": "var(--color-amber-400)"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "breadcrumb",
|
|
3
|
+
"type": "registry:ui",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"path": "registry/default/ui/breadcrumb.tsx",
|
|
7
|
+
"content": "\"use client\";\n\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { CaretRightIcon, DotsThreeIcon } from \"@phosphor-icons/react\";\nimport type * as React from \"react\";\nimport { cn } from \"@tc96/utils\";\n\nexport function Breadcrumb({\n ...props\n}: React.ComponentProps<\"nav\">): React.ReactElement {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" {...props} />;\n}\n\nexport function BreadcrumbList({\n className,\n ...props\n}: React.ComponentProps<\"ol\">): React.ReactElement {\n return (\n <ol\n className={cn(\n \"wrap-break-word flex flex-wrap items-center gap-1.5 text-muted-foreground text-sm sm:gap-2.5\",\n className,\n )}\n data-slot=\"breadcrumb-list\"\n {...props}\n />\n );\n}\n\nexport function BreadcrumbItem({\n className,\n ...props\n}: React.ComponentProps<\"li\">): React.ReactElement {\n return (\n <li\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n data-slot=\"breadcrumb-item\"\n {...props}\n />\n );\n}\n\nexport function BreadcrumbLink({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"a\">): React.ReactElement {\n const defaultProps = {\n className: cn(\"transition-colors hover:text-foreground\", className),\n \"data-slot\": \"breadcrumb-link\",\n };\n\n return useRender({\n defaultTagName: \"a\",\n props: mergeProps<\"a\">(defaultProps, props),\n render,\n });\n}\n\nexport function BreadcrumbPage({\n className,\n ...props\n}: React.ComponentProps<\"span\">): React.ReactElement {\n return (\n <span\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n data-slot=\"breadcrumb-page\"\n {...props}\n />\n );\n}\n\nexport function BreadcrumbSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">): React.ReactElement {\n return (\n <li\n aria-hidden=\"true\"\n className={cn(\"opacity-80 [&>svg]:size-4\", className)}\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n {...props}\n >\n {children ?? <CaretRightIcon aria-hidden=\"true\" />}\n </li>\n );\n}\n\nexport function BreadcrumbEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">): React.ReactElement {\n return (\n <span\n aria-hidden=\"true\"\n className={className}\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n {...props}\n >\n <DotsThreeIcon aria-hidden=\"true\" className=\"size-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n );\n}\n"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"dependencies": [
|
|
11
|
+
"@base-ui/react@1.8.0",
|
|
12
|
+
"@phosphor-icons/react@2.1.10"
|
|
13
|
+
],
|
|
14
|
+
"registryDependencies": []
|
|
15
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "button",
|
|
3
|
+
"type": "registry:ui",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"path": "registry/default/ui/button.tsx",
|
|
7
|
+
"content": "\"use client\";\n\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\nimport { cn } from \"@tc96/utils\";\nimport { Spinner } from \"@tc96/ui/spinner\";\n\nexport const buttonVariants = cva(\n \"relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 data-loading:select-none data-loading:text-transparent sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-mx-0.5 [&_svg]:shrink-0\",\n {\n defaultVariants: {\n size: \"default\",\n variant: \"default\",\n },\n variants: {\n size: {\n default: \"h-9 px-[calc(--spacing(3)-1px)] sm:h-8\",\n icon: \"size-9 sm:size-8\",\n \"icon-lg\": \"size-10 sm:size-9\",\n \"icon-sm\": \"size-8 sm:size-7\",\n \"icon-xl\":\n \"size-11 sm:size-10 [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5\",\n \"icon-xs\":\n \"size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-3.5\",\n lg: \"h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9\",\n sm: \"h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7\",\n xl: \"h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5\",\n xs: \"h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5\",\n },\n variant: {\n default:\n \"not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 data-pressed:bg-primary/90 *:data-[slot=button-loading-indicator]:text-primary-foreground [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none\",\n destructive:\n \"not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 data-pressed:bg-destructive/90 *:data-[slot=button-loading-indicator]:text-white [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none\",\n \"destructive-outline\":\n \"border-input bg-popover not-dark:bg-clip-padding text-destructive-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] hover:border-destructive/32 hover:bg-destructive/4 data-pressed:border-destructive/32 data-pressed:bg-destructive/4 *:data-[slot=button-loading-indicator]:text-foreground dark:bg-input/32 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none\",\n ghost:\n \"border-transparent text-foreground hover:bg-accent data-pressed:bg-accent *:data-[slot=button-loading-indicator]:text-foreground\",\n link: \"border-transparent text-foreground underline-offset-4 hover:underline data-pressed:underline *:data-[slot=button-loading-indicator]:text-foreground\",\n outline:\n \"border-input bg-popover not-dark:bg-clip-padding text-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] hover:bg-accent/50 data-pressed:bg-accent/50 *:data-[slot=button-loading-indicator]:text-foreground dark:bg-input/32 dark:data-pressed:bg-input/64 dark:hover:bg-input/64 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 data-pressed:bg-secondary/90 *:data-[slot=button-loading-indicator]:text-secondary-foreground [:active,[data-pressed]]:bg-secondary/80\",\n },\n },\n },\n);\n\nexport interface ButtonProps extends useRender.ComponentProps<\"button\"> {\n variant?: VariantProps<typeof buttonVariants>[\"variant\"];\n size?: VariantProps<typeof buttonVariants>[\"size\"];\n loading?: boolean;\n}\n\nexport function Button({\n className,\n variant,\n size,\n render,\n children,\n loading = false,\n disabled: disabledProp,\n ...props\n}: ButtonProps): React.ReactElement {\n const isDisabled: boolean = Boolean(loading || disabledProp);\n const typeValue: React.ButtonHTMLAttributes<HTMLButtonElement>[\"type\"] =\n render ? undefined : \"button\";\n\n const defaultProps = {\n children: (\n <>\n {children}\n {loading && (\n <Spinner\n className=\"pointer-events-none absolute\"\n data-slot=\"button-loading-indicator\"\n />\n )}\n </>\n ),\n className: cn(buttonVariants({ className, size, variant })),\n \"aria-disabled\": loading || undefined,\n \"data-loading\": loading ? \"\" : undefined,\n \"data-slot\": \"button\",\n disabled: isDisabled,\n type: typeValue,\n };\n\n return useRender({\n defaultTagName: \"button\",\n props: mergeProps<\"button\">(defaultProps, props),\n render,\n });\n}\n"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"dependencies": [
|
|
11
|
+
"@base-ui/react@1.8.0",
|
|
12
|
+
"class-variance-authority@0.7.1"
|
|
13
|
+
],
|
|
14
|
+
"registryDependencies": [
|
|
15
|
+
"@ui/spinner"
|
|
16
|
+
],
|
|
17
|
+
"cssVars": {
|
|
18
|
+
"light": {
|
|
19
|
+
"destructive-foreground": "var(--color-red-700)"
|
|
20
|
+
},
|
|
21
|
+
"dark": {
|
|
22
|
+
"destructive-foreground": "var(--color-red-400)"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "calendar",
|
|
3
|
+
"type": "registry:ui",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"path": "registry/default/ui/calendar.tsx",
|
|
7
|
+
"content": "\"use client\";\n\nimport { type DateLib, DayPicker } from \"@daypicker/react\";\nimport { CaretLeftIcon, CaretRightIcon, CaretUpDownIcon } from \"@phosphor-icons/react\";\nimport type * as React from \"react\";\nimport { cn } from \"@tc96/utils\";\n\nconst buttonClassNames =\n \"relative flex size-(--cell-size) text-base sm:text-sm items-center justify-center rounded-lg text-foreground not-in-data-selected:hover:bg-accent disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\";\n\nexport function Calendar({\n className,\n classNames,\n showOutsideDays = true,\n components: userComponents,\n mode = \"single\",\n ...props\n}: React.ComponentProps<typeof DayPicker>): React.ReactElement {\n const defaultClassNames = {\n button_next: buttonClassNames,\n button_previous: buttonClassNames,\n caption_label:\n \"text-base sm:text-sm font-medium flex items-center gap-2 h-full\",\n day: \"size-(--cell-size) text-sm py-px\",\n day_button: cn(\n buttonClassNames,\n \"in-data-disabled:pointer-events-none in-[.range-middle]:rounded-none in-[.range-end:not(.range-start)]:rounded-s-none in-[.range-start:not(.range-end)]:rounded-e-none in-[.range-middle]:in-data-selected:bg-accent in-data-selected:bg-primary in-[.range-middle]:in-data-selected:text-foreground in-data-disabled:text-muted-foreground/72 in-data-outside:text-muted-foreground/96 in-data-selected:in-data-outside:text-primary-foreground in-data-selected:text-primary-foreground in-data-disabled:line-through outline-none in-[[data-selected]:not(.range-middle)]:transition-[border-radius,box-shadow] focus-visible:z-1 focus-visible:ring-[3px] focus-visible:ring-ring/50\",\n ),\n dropdown: \"absolute bg-popover inset-0 opacity-0\",\n dropdown_root:\n \"relative has-focus:border-ring has-focus:ring-ring/50 has-focus:ring-[3px] border border-input shadow-xs/5 rounded-lg px-[calc(--spacing(3)-1px)] h-9 sm:h-8 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-me-1\",\n dropdowns:\n \"w-full flex items-center text-base sm:text-sm justify-center h-(--cell-size) gap-1.5 *:[span]:font-medium\",\n hidden: \"invisible\",\n month: \"w-full\",\n month_caption:\n \"relative mx-(--cell-size) px-1 mb-1 flex h-(--cell-size) items-center justify-center z-2\",\n months: \"relative flex flex-col sm:flex-row gap-2\",\n nav: \"absolute top-0 flex w-full justify-between z-1\",\n outside:\n \"text-muted-foreground data-selected:bg-accent/50 data-selected:text-muted-foreground\",\n range_end: \"range-end\",\n range_middle: \"range-middle\",\n range_start: \"range-start\",\n today:\n \"*:after:pointer-events-none *:after:absolute *:after:bottom-1 *:after:start-1/2 *:after:z-1 *:after:size-[3px] *:after:-translate-x-1/2 *:after:rounded-full *:after:bg-primary [&[data-selected]:not(.range-middle)>*]:after:bg-background [&[data-disabled]>*]:after:bg-foreground/30\",\n week_number:\n \"size-(--cell-size) p-0 text-xs font-medium text-muted-foreground/96\",\n weekday:\n \"size-(--cell-size) p-0 text-xs font-medium text-muted-foreground/96\",\n };\n const mergedClassNames: typeof defaultClassNames = Object.keys(\n defaultClassNames,\n ).reduce(\n (acc, key) => {\n const userClass = classNames?.[key as keyof typeof classNames];\n const baseClass =\n defaultClassNames[key as keyof typeof defaultClassNames];\n\n acc[key as keyof typeof defaultClassNames] = userClass\n ? cn(baseClass, userClass)\n : baseClass;\n\n return acc;\n },\n { ...defaultClassNames } as typeof defaultClassNames,\n );\n\n const defaultComponents = {\n Chevron: ({\n className,\n orientation,\n ...props\n }: {\n className?: string;\n orientation?: \"left\" | \"right\" | \"up\" | \"down\";\n }): React.ReactElement => {\n if (orientation === \"left\") {\n return (\n <CaretLeftIcon\n className={cn(className, \"rtl:rotate-180\")}\n {...props}\n aria-hidden=\"true\"\n />\n );\n }\n\n if (orientation === \"right\") {\n return (\n <CaretRightIcon\n className={cn(className, \"rtl:rotate-180\")}\n {...props}\n aria-hidden=\"true\"\n />\n );\n }\n\n return (\n <CaretUpDownIcon\n className={className}\n {...props}\n aria-hidden=\"true\"\n />\n );\n },\n };\n\n const mergedComponents = {\n ...defaultComponents,\n ...userComponents,\n };\n\n const dayPickerProps = {\n className: cn(\n \"w-fit [--cell-size:--spacing(10)] sm:[--cell-size:--spacing(9)]\",\n className,\n ),\n classNames: mergedClassNames,\n components: mergedComponents,\n \"data-slot\": \"calendar\",\n formatters: {\n formatMonthDropdown: (month: Date, dateLib: DateLib) =>\n dateLib.format(month, \"LLL\"),\n } as React.ComponentProps<typeof DayPicker>[\"formatters\"],\n mode,\n showOutsideDays,\n ...props,\n };\n\n return (\n <DayPicker\n {...(dayPickerProps as React.ComponentProps<typeof DayPicker>)}\n />\n );\n}\n"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"dependencies": [
|
|
11
|
+
"@daypicker/react@10.0.2",
|
|
12
|
+
"@phosphor-icons/react@2.1.10"
|
|
13
|
+
],
|
|
14
|
+
"registryDependencies": []
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "card",
|
|
3
|
+
"type": "registry:ui",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"path": "registry/default/ui/card.tsx",
|
|
7
|
+
"content": "\"use client\";\n\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport type React from \"react\";\nimport { cn } from \"@tc96/utils\";\n\nexport function Card({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\n \"relative flex flex-col rounded-2xl border bg-card not-dark:bg-clip-padding text-card-foreground shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]\",\n className,\n ),\n \"data-slot\": \"card\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardFrame({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\n \"relative flex flex-col rounded-2xl border bg-card not-dark:bg-clip-padding text-card-foreground shadow-xs/5 [--clip-bottom:-1rem] [--clip-top:-1rem] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:bg-muted/72 before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=table-container]:overflow-hidden *:data-[slot=card]:-m-px *:data-[slot=table-container]:-m-px *:data-[slot=table-container]:w-[calc(100%+2px)] *:not-first:data-[slot=card]:rounded-t-xl *:not-last:data-[slot=card]:rounded-b-xl *:data-[slot=card]:bg-clip-padding *:data-[slot=card]:shadow-none *:data-[slot=card]:before:hidden *:not-first:data-[slot=card]:before:rounded-t-[calc(var(--radius-xl)-1px)] *:not-last:data-[slot=card]:before:rounded-b-[calc(var(--radius-xl)-1px)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)] *:data-[slot=card]:[clip-path:inset(var(--clip-top)_1px_var(--clip-bottom)_1px_round_calc(var(--radius-2xl)-1px))] *:data-[slot=card]:last:[--clip-bottom:1px] *:data-[slot=card]:first:[--clip-top:1px]\",\n className,\n ),\n \"data-slot\": \"card-frame\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardFrameHeader({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\n \"relative flex grid auto-rows-min grid-rows-[auto_auto] flex-col items-start gap-x-4 px-6 py-4 has-data-[slot=card-frame-action]:grid-cols-[1fr_auto]\",\n className,\n ),\n \"data-slot\": \"card-frame-header\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardFrameTitle({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\"self-center font-semibold text-sm\", className),\n \"data-slot\": \"card-frame-title\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardFrameDescription({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\"self-center text-muted-foreground text-sm\", className),\n \"data-slot\": \"card-frame-description\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardFrameAction({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\n \"col-start-2 nth-3:row-span-2 nth-3:row-start-1 inline-flex self-center justify-self-end\",\n className,\n ),\n \"data-slot\": \"card-frame-action\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardFrameFooter({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\"px-6 py-4\", className),\n \"data-slot\": \"card-frame-footer\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardHeader({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\n \"grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 p-6 in-[[data-slot=card]:has(>[data-slot=card-panel])]:pb-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]\",\n className,\n ),\n \"data-slot\": \"card-header\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardTitle({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\"font-heading font-semibold text-lg leading-none\", className),\n \"data-slot\": \"card-title\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardDescription({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\"text-muted-foreground text-sm\", className),\n \"data-slot\": \"card-description\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardAction({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\n \"col-start-2 row-span-2 row-start-1 inline-flex self-start justify-self-end\",\n className,\n ),\n \"data-slot\": \"card-action\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardPanel({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\n \"flex-1 p-6 in-[[data-slot=card]:has(>[data-slot=card-header]:not(.border-b))]:pt-0 in-[[data-slot=card]:has(>[data-slot=card-footer]:not(.border-t))]:pb-0\",\n className,\n ),\n \"data-slot\": \"card-panel\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport function CardFooter({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">): React.ReactElement {\n const defaultProps = {\n className: cn(\n \"flex items-center p-6 in-[[data-slot=card]:has(>[data-slot=card-panel])]:pt-4\",\n className,\n ),\n \"data-slot\": \"card-footer\",\n };\n\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(defaultProps, props),\n render,\n });\n}\n\nexport { CardPanel as CardContent };\n"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"dependencies": [
|
|
11
|
+
"@base-ui/react@1.8.0"
|
|
12
|
+
],
|
|
13
|
+
"registryDependencies": []
|
|
14
|
+
}
|