@skunkworksai/ui-kit 0.1.18
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/AGENTS.md +250 -0
- package/README.md +429 -0
- package/dist/assets/Service-applets-apps/audience-measurement.png +0 -0
- package/dist/assets/Service-applets-apps/coatro-app.png +0 -0
- package/dist/assets/Service-applets-apps/content-effectiveness.png +0 -0
- package/dist/assets/Service-applets-apps/hop-tracking.png +0 -0
- package/dist/assets/Service-applets-apps/index.ts +13 -0
- package/dist/assets/Service-applets-apps/journeys-app.png +0 -0
- package/dist/assets/Service-applets-apps/people-counting.png +0 -0
- package/dist/assets/Service-applets-apps/petra.png +0 -0
- package/dist/assets/Service-applets-apps/sam-generic.png +0 -0
- package/dist/assets/Service-applets-apps/sami-for-environment.png +0 -0
- package/dist/assets/Service-applets-apps/shelf-engagement.png +0 -0
- package/dist/assets/Service-applets-apps/traffic-management.png +0 -0
- package/dist/assets/Service-applets-apps/viana.png +0 -0
- package/dist/assets/Service-applets-apps/zone-engagement.png +0 -0
- package/dist/assets/icons/Dashboard-active.svg +29 -0
- package/dist/assets/icons/Dashboard.svg +25 -0
- package/dist/assets/icons/DashboardActiveIcon.tsx +35 -0
- package/dist/assets/icons/DashboardIcon.tsx +31 -0
- package/dist/assets/icons/Devices-active.svg +27 -0
- package/dist/assets/icons/Devices.svg +20 -0
- package/dist/assets/icons/DevicesActiveIcon.tsx +33 -0
- package/dist/assets/icons/DevicesIcon.tsx +26 -0
- package/dist/assets/icons/Installer-active.svg +29 -0
- package/dist/assets/icons/Installer.svg +17 -0
- package/dist/assets/icons/InstallerActiveIcon.tsx +35 -0
- package/dist/assets/icons/InstallerIcon.tsx +23 -0
- package/dist/assets/icons/Manifest-active.svg +49 -0
- package/dist/assets/icons/Manifest.svg +49 -0
- package/dist/assets/icons/ManifestActiveIcon.tsx +55 -0
- package/dist/assets/icons/ManifestIcon.tsx +55 -0
- package/dist/assets/icons/Sensor-active.svg +15 -0
- package/dist/assets/icons/Sensor.svg +11 -0
- package/dist/assets/icons/SensorActiveIcon.tsx +21 -0
- package/dist/assets/icons/SensorIcon.tsx +17 -0
- package/dist/assets/icons/Site-active.svg +14 -0
- package/dist/assets/icons/Site.svg +10 -0
- package/dist/assets/icons/SiteActiveIcon.tsx +20 -0
- package/dist/assets/icons/SiteIcon.tsx +16 -0
- package/dist/assets/icons/X-ray-active.svg +199 -0
- package/dist/assets/icons/X-ray.svg +47 -0
- package/dist/assets/icons/XrayActiveIcon.tsx +205 -0
- package/dist/assets/icons/XrayIcon.tsx +53 -0
- package/dist/assets/icons/index.ts +14 -0
- package/dist/assets/logos/DarkLogo.tsx +28 -0
- package/dist/assets/logos/DarkSymbol.tsx +9 -0
- package/dist/assets/logos/PrimaryLogo.tsx +28 -0
- package/dist/assets/logos/PrimarySymbol.tsx +9 -0
- package/dist/assets/logos/WhiteLogo.tsx +28 -0
- package/dist/assets/logos/WhiteSymbol.tsx +9 -0
- package/dist/assets/logos/dark_logo.svg +22 -0
- package/dist/assets/logos/dark_symbol.svg +3 -0
- package/dist/assets/logos/index.ts +6 -0
- package/dist/assets/logos/primary-logo.svg +22 -0
- package/dist/assets/logos/primary_logo.svg +22 -0
- package/dist/assets/logos/primary_symbol.svg +3 -0
- package/dist/assets/logos/white_symbol.svg +3 -0
- package/dist/index.cjs +160 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +45276 -0
- package/dist/index.js.map +1 -0
- package/dist/tokens-source.css +121 -0
- package/dist/types/assets/Service-applets-apps/index.d.ts +13 -0
- package/dist/types/assets/icons/DashboardActiveIcon.d.ts +2 -0
- package/dist/types/assets/icons/DashboardIcon.d.ts +2 -0
- package/dist/types/assets/icons/DevicesActiveIcon.d.ts +2 -0
- package/dist/types/assets/icons/DevicesIcon.d.ts +2 -0
- package/dist/types/assets/icons/InstallerActiveIcon.d.ts +2 -0
- package/dist/types/assets/icons/InstallerIcon.d.ts +2 -0
- package/dist/types/assets/icons/ManifestActiveIcon.d.ts +2 -0
- package/dist/types/assets/icons/ManifestIcon.d.ts +2 -0
- package/dist/types/assets/icons/SensorActiveIcon.d.ts +2 -0
- package/dist/types/assets/icons/SensorIcon.d.ts +2 -0
- package/dist/types/assets/icons/SiteActiveIcon.d.ts +2 -0
- package/dist/types/assets/icons/SiteIcon.d.ts +2 -0
- package/dist/types/assets/icons/XrayActiveIcon.d.ts +2 -0
- package/dist/types/assets/icons/XrayIcon.d.ts +2 -0
- package/dist/types/assets/icons/index.d.ts +14 -0
- package/dist/types/assets/logos/DarkLogo.d.ts +2 -0
- package/dist/types/assets/logos/DarkSymbol.d.ts +2 -0
- package/dist/types/assets/logos/PrimaryLogo.d.ts +2 -0
- package/dist/types/assets/logos/PrimarySymbol.d.ts +2 -0
- package/dist/types/assets/logos/WhiteLogo.d.ts +2 -0
- package/dist/types/assets/logos/WhiteSymbol.d.ts +2 -0
- package/dist/types/assets/logos/index.d.ts +6 -0
- package/dist/types/components/blocks/AppBentoMenu.d.ts +31 -0
- package/dist/types/components/blocks/AppDashboard.d.ts +121 -0
- package/dist/types/components/blocks/AppHeader.d.ts +198 -0
- package/dist/types/components/blocks/AppLocationTreeFilter.d.ts +44 -0
- package/dist/types/components/blocks/AppNotificationsMenu.d.ts +50 -0
- package/dist/types/components/blocks/AppPageTitle.d.ts +86 -0
- package/dist/types/components/blocks/AppProfile.d.ts +53 -0
- package/dist/types/components/blocks/TableManager.d.ts +194 -0
- package/dist/types/components/blocks/backgrounds/AppDashboardBackgroundDots.d.ts +14 -0
- package/dist/types/components/blocks/backgrounds/AppDashboardBackgroundWave.d.ts +14 -0
- package/dist/types/components/blocks/backgrounds/index.d.ts +3 -0
- package/dist/types/components/blocks/backgrounds/types.d.ts +13 -0
- package/dist/types/components/blocks/index.d.ts +9 -0
- package/dist/types/components/primitives/AppAccordion.d.ts +22 -0
- package/dist/types/components/primitives/AppAlert.d.ts +33 -0
- package/dist/types/components/primitives/AppAlertDialog.d.ts +79 -0
- package/dist/types/components/primitives/AppAspectRatio.d.ts +7 -0
- package/dist/types/components/primitives/AppAvatar.d.ts +17 -0
- package/dist/types/components/primitives/AppBadge.d.ts +9 -0
- package/dist/types/components/primitives/AppBreadcrumb.d.ts +45 -0
- package/dist/types/components/primitives/AppButton.d.ts +24 -0
- package/dist/types/components/primitives/AppButtonGroup.d.ts +10 -0
- package/dist/types/components/primitives/AppCalendar.d.ts +51 -0
- package/dist/types/components/primitives/AppCard.d.ts +41 -0
- package/dist/types/components/primitives/AppCarousel.d.ts +26 -0
- package/dist/types/components/primitives/AppChart.d.ts +27 -0
- package/dist/types/components/primitives/AppCheckbox.d.ts +9 -0
- package/dist/types/components/primitives/AppCollapsible.d.ts +20 -0
- package/dist/types/components/primitives/AppCombobox.d.ts +37 -0
- package/dist/types/components/primitives/AppCommand.d.ts +47 -0
- package/dist/types/components/primitives/AppContextMenu.d.ts +82 -0
- package/dist/types/components/primitives/AppDataTable.d.ts +23 -0
- package/dist/types/components/primitives/AppDatePicker.d.ts +26 -0
- package/dist/types/components/primitives/AppDialog.d.ts +40 -0
- package/dist/types/components/primitives/AppDrawer.d.ts +58 -0
- package/dist/types/components/primitives/AppDropdownMenu.d.ts +85 -0
- package/dist/types/components/primitives/AppEmpty.d.ts +35 -0
- package/dist/types/components/primitives/AppField.d.ts +65 -0
- package/dist/types/components/primitives/AppForm.d.ts +58 -0
- package/dist/types/components/primitives/AppHoverCard.d.ts +19 -0
- package/dist/types/components/primitives/AppInput.d.ts +21 -0
- package/dist/types/components/primitives/AppKbd.d.ts +18 -0
- package/dist/types/components/primitives/AppLabel.d.ts +8 -0
- package/dist/types/components/primitives/AppMenubar.d.ts +83 -0
- package/dist/types/components/primitives/AppNavigationMenu.d.ts +51 -0
- package/dist/types/components/primitives/AppPagination.d.ts +46 -0
- package/dist/types/components/primitives/AppPopover.d.ts +20 -0
- package/dist/types/components/primitives/AppProgress.d.ts +9 -0
- package/dist/types/components/primitives/AppRadioGroup.d.ts +15 -0
- package/dist/types/components/primitives/AppScrollArea.d.ts +12 -0
- package/dist/types/components/primitives/AppScrollText.d.ts +7 -0
- package/dist/types/components/primitives/AppSelect.d.ts +46 -0
- package/dist/types/components/primitives/AppSeparator.d.ts +8 -0
- package/dist/types/components/primitives/AppSheet.d.ts +32 -0
- package/dist/types/components/primitives/AppSidebar.d.ts +59 -0
- package/dist/types/components/primitives/AppSkeleton.d.ts +6 -0
- package/dist/types/components/primitives/AppSpinner.d.ts +13 -0
- package/dist/types/components/primitives/AppSwitch.d.ts +8 -0
- package/dist/types/components/primitives/AppTable.d.ts +53 -0
- package/dist/types/components/primitives/AppTabs.d.ts +10 -0
- package/dist/types/components/primitives/AppTextarea.d.ts +9 -0
- package/dist/types/components/primitives/AppThemeProvider.d.ts +46 -0
- package/dist/types/components/primitives/AppToaster.d.ts +7 -0
- package/dist/types/components/primitives/AppToggle.d.ts +9 -0
- package/dist/types/components/primitives/AppToggleGroup.d.ts +18 -0
- package/dist/types/components/primitives/AppTooltip.d.ts +26 -0
- package/dist/types/components/primitives/AppTypography.d.ts +80 -0
- package/dist/types/components/primitives/index.d.ts +57 -0
- package/dist/types/components/ui/accordion.d.ts +7 -0
- package/dist/types/components/ui/alert-dialog.d.ts +20 -0
- package/dist/types/components/ui/alert.d.ts +8 -0
- package/dist/types/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/types/components/ui/avatar.d.ts +6 -0
- package/dist/types/components/ui/badge.d.ts +9 -0
- package/dist/types/components/ui/breadcrumb.d.ts +19 -0
- package/dist/types/components/ui/button.d.ts +13 -0
- package/dist/types/components/ui/calendar.d.ts +8 -0
- package/dist/types/components/ui/card.d.ts +11 -0
- package/dist/types/components/ui/carousel.d.ts +28 -0
- package/dist/types/components/ui/chart.d.ts +48 -0
- package/dist/types/components/ui/checkbox.d.ts +4 -0
- package/dist/types/components/ui/collapsible.d.ts +6 -0
- package/dist/types/components/ui/combobox.d.ts +83 -0
- package/dist/types/components/ui/command.d.ts +82 -0
- package/dist/types/components/ui/context-menu.d.ts +27 -0
- package/dist/types/components/ui/dialog.d.ts +19 -0
- package/dist/types/components/ui/drawer.d.ts +23 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/types/components/ui/empty.d.ts +14 -0
- package/dist/types/components/ui/field.d.ts +40 -0
- package/dist/types/components/ui/form.d.ts +22 -0
- package/dist/types/components/ui/hover-card.d.ts +6 -0
- package/dist/types/components/ui/input.d.ts +3 -0
- package/dist/types/components/ui/kbd.d.ts +4 -0
- package/dist/types/components/ui/label.d.ts +4 -0
- package/dist/types/components/ui/menubar.d.ts +30 -0
- package/dist/types/components/ui/navigation-menu.d.ts +12 -0
- package/dist/types/components/ui/pagination.d.ts +28 -0
- package/dist/types/components/ui/popover.d.ts +6 -0
- package/dist/types/components/ui/progress.d.ts +4 -0
- package/dist/types/components/ui/radio-group.d.ts +5 -0
- package/dist/types/components/ui/scroll-area.d.ts +5 -0
- package/dist/types/components/ui/scroll-text.d.ts +6 -0
- package/dist/types/components/ui/select.d.ts +13 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +25 -0
- package/dist/types/components/ui/sidebar.d.ts +69 -0
- package/dist/types/components/ui/skeleton.d.ts +2 -0
- package/dist/types/components/ui/sonner.d.ts +2 -0
- package/dist/types/components/ui/switch.d.ts +4 -0
- package/dist/types/components/ui/table.d.ts +10 -0
- package/dist/types/components/ui/tabs.d.ts +19 -0
- package/dist/types/components/ui/textarea.d.ts +5 -0
- package/dist/types/components/ui/toggle-group.d.ts +15 -0
- package/dist/types/components/ui/toggle.d.ts +12 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/hooks/use-mobile.d.ts +13 -0
- package/dist/types/hooks/use-page-title.d.ts +23 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/ui-kit.css +1 -0
- package/package.json +117 -0
- package/rules/accordion.md +60 -0
- package/rules/alert-dialog.md +62 -0
- package/rules/alert.md +61 -0
- package/rules/aspect-ratio.md +47 -0
- package/rules/avatar.md +52 -0
- package/rules/badge.md +55 -0
- package/rules/bento-menu.md +86 -0
- package/rules/breadcrumb.md +80 -0
- package/rules/button-group.md +58 -0
- package/rules/button.md +66 -0
- package/rules/calendar.md +97 -0
- package/rules/card.md +84 -0
- package/rules/carousel.md +113 -0
- package/rules/chart.md +125 -0
- package/rules/checkbox.md +49 -0
- package/rules/collapsible.md +57 -0
- package/rules/combobox.md +133 -0
- package/rules/command.md +73 -0
- package/rules/context-menu.md +65 -0
- package/rules/dashboard.md +368 -0
- package/rules/data-table.md +91 -0
- package/rules/date-picker.md +65 -0
- package/rules/dialog.md +60 -0
- package/rules/drawer.md +65 -0
- package/rules/dropdown-menu.md +72 -0
- package/rules/empty.md +110 -0
- package/rules/field.md +149 -0
- package/rules/form.md +60 -0
- package/rules/header.md +245 -0
- package/rules/hover-card.md +53 -0
- package/rules/icons.md +141 -0
- package/rules/input.md +66 -0
- package/rules/kbd.md +58 -0
- package/rules/label.md +30 -0
- package/rules/location-tree-filter.md +165 -0
- package/rules/logo.md +58 -0
- package/rules/menubar.md +75 -0
- package/rules/navigation-menu.md +68 -0
- package/rules/notifications-menu.md +137 -0
- package/rules/pagetitle.md +160 -0
- package/rules/pagination.md +71 -0
- package/rules/popover.md +48 -0
- package/rules/profile.md +125 -0
- package/rules/progress.md +41 -0
- package/rules/radio-group.md +44 -0
- package/rules/scroll-area.md +32 -0
- package/rules/scroll-text.md +40 -0
- package/rules/select.md +86 -0
- package/rules/separator.md +43 -0
- package/rules/sheet.md +76 -0
- package/rules/sidebar.md +442 -0
- package/rules/skeleton.md +46 -0
- package/rules/spinner.md +43 -0
- package/rules/switch.md +46 -0
- package/rules/table-manager.md +306 -0
- package/rules/table.md +177 -0
- package/rules/tabs.md +82 -0
- package/rules/text.md +3 -0
- package/rules/textarea.md +38 -0
- package/rules/toaster.md +58 -0
- package/rules/toggle-group.md +50 -0
- package/rules/toggle.md +40 -0
- package/rules/tokens.md +88 -0
- package/rules/tooltip.md +78 -0
- package/rules/typography.md +81 -0
- package/scripts/scaffold.mjs +28 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# AppToggleGroup
|
|
2
|
+
|
|
3
|
+
> Docs: https://ui-kit.vercel.app/docs/components/toggle-group
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { AppToggleGroup, AppToggleGroupItem } from "@/components/primitives/AppToggleGroup"
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## AppToggleGroup
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
|------|------|---------|-------------|
|
|
13
|
+
| `type` | `"single" \| "multiple"` | — | Determines if one or multiple items can be pressed |
|
|
14
|
+
| `variant` | `"default" \| "outline"` | `"default"` | Visual style shared by all items |
|
|
15
|
+
| `size` | `"default" \| "sm" \| "lg"` | `"default"` | Size shared by all items |
|
|
16
|
+
| `value` | `string \| string[]` | — | Controlled value |
|
|
17
|
+
| `onValueChange` | `(value: any) => void` | — | Callback when value changes |
|
|
18
|
+
|
|
19
|
+
## AppToggleGroupItem
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Default | Description |
|
|
22
|
+
|------|------|---------|-------------|
|
|
23
|
+
| `value` | `string` | — | Unique value for this item |
|
|
24
|
+
| `disabled` | `boolean` | `false` | Disables this item |
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### Single Select
|
|
29
|
+
```tsx
|
|
30
|
+
<AppToggleGroup type="single">
|
|
31
|
+
<AppToggleGroupItem value="left">Left</AppToggleGroupItem>
|
|
32
|
+
<AppToggleGroupItem value="center">Center</AppToggleGroupItem>
|
|
33
|
+
<AppToggleGroupItem value="right">Right</AppToggleGroupItem>
|
|
34
|
+
</AppToggleGroup>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Multiple Select (Outline)
|
|
38
|
+
```tsx
|
|
39
|
+
<AppToggleGroup type="multiple" variant="outline">
|
|
40
|
+
<AppToggleGroupItem value="bold"><Bold /></AppToggleGroupItem>
|
|
41
|
+
<AppToggleGroupItem value="italic"><Italic /></AppToggleGroupItem>
|
|
42
|
+
</AppToggleGroup>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Rules
|
|
46
|
+
- ✅ Use `AppToggleGroup` for related sets of options
|
|
47
|
+
- ✅ Set `type="single"` or `type="multiple"` explicitly
|
|
48
|
+
- ✅ Use `variant="outline"` when items should be clearly separated
|
|
49
|
+
- ❌ Do not add hover styles to the `ToggleGroup` container — hover belongs on items only
|
|
50
|
+
- ❌ If a prop you need is missing, stop and inform the design team
|
package/rules/toggle.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# AppToggle
|
|
2
|
+
|
|
3
|
+
> Docs: https://ui-kit.vercel.app/docs/components/toggle
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { AppToggle } from "@/components/primitives/AppToggle"
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
|------|------|---------|-------------|
|
|
13
|
+
| `variant` | `"default" \| "outline"` | `"default"` | Visual style |
|
|
14
|
+
| `size` | `"default" \| "sm" \| "lg"` | `"default"` | Size of the toggle |
|
|
15
|
+
| `pressed` | `boolean` | — | Controlled pressed state |
|
|
16
|
+
| `onPressedChange` | `(pressed: boolean) => void` | — | Callback when pressed state changes |
|
|
17
|
+
| `disabled` | `boolean` | `false` | Disables the toggle |
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Basic
|
|
22
|
+
```tsx
|
|
23
|
+
<AppToggle aria-label="Toggle italic">
|
|
24
|
+
<Italic className="h-4 w-4" />
|
|
25
|
+
</AppToggle>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Outline variant
|
|
29
|
+
```tsx
|
|
30
|
+
<AppToggle variant="outline" aria-label="Toggle bold">
|
|
31
|
+
<Bold className="h-4 w-4" />
|
|
32
|
+
</AppToggle>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Rules
|
|
36
|
+
- ✅ Use `AppToggle` for simple on/off states that don't look like switches
|
|
37
|
+
- ✅ Always provide an `aria-label` when using icon-only toggles
|
|
38
|
+
- ✅ Use `variant="outline"` for secondary actions
|
|
39
|
+
- ❌ Do not use `AppToggle` for navigation
|
|
40
|
+
- ❌ If a prop you need is missing, stop and inform the design team
|
package/rules/tokens.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Token rules
|
|
2
|
+
|
|
3
|
+
## Where tokens are defined
|
|
4
|
+
|
|
5
|
+
All design tokens are CSS custom properties defined in `dist/tokens-source.css` (shipped with the package). This file is the single source of truth for all color, typography, radius, shadow, and spacing values.
|
|
6
|
+
|
|
7
|
+
## Token source file
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
node_modules/@skunkworksai/ui-kit/dist/tokens-source.css
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Tweakcn-compatible format — contains `@import "tailwindcss"`, `:root {}`, `.dark {}`, and `@theme inline {}` blocks.
|
|
14
|
+
|
|
15
|
+
## Required setup — scaffold tokens.css
|
|
16
|
+
|
|
17
|
+
`@skunkworksai/ui-kit/styles` ships infrastructure-only CSS — no color values. Without a token file the UI renders with no colors.
|
|
18
|
+
|
|
19
|
+
During project setup, copy the token source into the consumer project:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
cp node_modules/@skunkworksai/ui-kit/dist/tokens-source.css src/tokens.css
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then import both files in the app entry — **order matters**:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
// main.tsx
|
|
29
|
+
import '@skunkworksai/ui-kit/styles' // infrastructure first
|
|
30
|
+
import './tokens.css' // token values second
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Customizing tokens
|
|
34
|
+
|
|
35
|
+
Edit `src/tokens.css` directly. Use [tweakcn.com](https://tweakcn.com) to adjust values visually — paste the file in, tweak, paste back.
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
/* src/tokens.css */
|
|
39
|
+
:root {
|
|
40
|
+
--primary: oklch(0.6 0.2 250);
|
|
41
|
+
--radius: 0.75rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dark {
|
|
45
|
+
--primary: oklch(0.65 0.2 250);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Using tokens in components
|
|
50
|
+
|
|
51
|
+
Always reference tokens via Tailwind utility classes, never hardcode values:
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
// ✅ Correct
|
|
55
|
+
<div className="bg-background text-foreground" />
|
|
56
|
+
<div className="bg-primary text-primary-foreground" />
|
|
57
|
+
<div className="border-border rounded-lg shadow-md" />
|
|
58
|
+
|
|
59
|
+
// ❌ Wrong
|
|
60
|
+
<div style={{ background: '#fff', color: '#111' }} />
|
|
61
|
+
<div className="bg-blue-500" />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Available token groups
|
|
65
|
+
|
|
66
|
+
| Group | Tokens |
|
|
67
|
+
|-------|--------|
|
|
68
|
+
| Brand | `--primary`, `--primary-foreground`, `--secondary`, `--secondary-foreground`, `--accent`, `--accent-foreground` |
|
|
69
|
+
| Surface | `--background`, `--foreground`, `--card`, `--card-foreground`, `--popover`, `--popover-foreground`, `--muted`, `--muted-foreground` |
|
|
70
|
+
| Status | `--destructive`, `--destructive-foreground`, `--success`, `--success-foreground`, `--warning`, `--warning-foreground` |
|
|
71
|
+
| Border | `--border`, `--input`, `--ring` |
|
|
72
|
+
| Sidebar | `--sidebar`, `--sidebar-foreground`, `--sidebar-primary`, `--sidebar-primary-foreground`, `--sidebar-accent`, `--sidebar-accent-foreground`, `--sidebar-border`, `--sidebar-ring` |
|
|
73
|
+
| Shape | `--radius` (base), `--radius-sm`, `--radius-md`, `--radius-lg`, `--radius-xl` |
|
|
74
|
+
| Shadow | `--shadow`, `--shadow-sm`, `--shadow-md`, `--shadow-lg`, `--shadow-xl`, `--shadow-2xl` |
|
|
75
|
+
| Typography | `--font-sans`, `--font-mono`, `--font-serif` |
|
|
76
|
+
| Charts | `--chart-1` through `--chart-5` |
|
|
77
|
+
|
|
78
|
+
## Dark mode
|
|
79
|
+
|
|
80
|
+
Dark mode activates when `.dark` class is on a parent element (managed by `AppThemeProvider`). Tokens update automatically — no `dark:` Tailwind prefix needed on color classes.
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
// ✅ Correct — color flips automatically in dark mode
|
|
84
|
+
<div className="bg-background text-foreground" />
|
|
85
|
+
|
|
86
|
+
// ❌ Wrong — manual dark override, fighting the token system
|
|
87
|
+
<div className="bg-white dark:bg-gray-900" />
|
|
88
|
+
```
|
package/rules/tooltip.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# AppTooltip
|
|
2
|
+
|
|
3
|
+
> Docs: https://ui-kit.vercel.app/docs/components/tooltip
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { AppTooltip, AppTooltipProvider, AppTooltipTrigger, AppTooltipContent } from "@/components/primitives/AppTooltip"
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## AppTooltip
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
|------|------|---------|-------------|
|
|
13
|
+
| `delayDuration` | `number` | `700` | Delay in ms before showing the tooltip |
|
|
14
|
+
| `open` | `boolean` | — | Controlled open state |
|
|
15
|
+
| `onOpenChange` | `(open: boolean) => void` | — | Callback when open state changes |
|
|
16
|
+
|
|
17
|
+
## AppTooltipTrigger
|
|
18
|
+
|
|
19
|
+
| Prop | Type | Default | Description |
|
|
20
|
+
|------|------|---------|-------------|
|
|
21
|
+
| `asChild` | `boolean` | `false` | Merges props onto child element. Use when wrapping an existing interactive element. |
|
|
22
|
+
|
|
23
|
+
## AppTooltipContent
|
|
24
|
+
|
|
25
|
+
| Prop | Type | Default | Description |
|
|
26
|
+
|------|------|---------|-------------|
|
|
27
|
+
| `side` | `"top" \| "right" \| "bottom" \| "left"` | `"top"` | Preferred side for the content |
|
|
28
|
+
| `sideOffset` | `number` | `4` | Distance from the trigger in pixels |
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
### Basic
|
|
33
|
+
```tsx
|
|
34
|
+
<AppTooltipProvider>
|
|
35
|
+
<AppTooltip>
|
|
36
|
+
<AppTooltipTrigger asChild>
|
|
37
|
+
<AppButton variant="outline">Hover me</AppButton>
|
|
38
|
+
</AppTooltipTrigger>
|
|
39
|
+
<AppTooltipContent>
|
|
40
|
+
<p>Add to library</p>
|
|
41
|
+
</AppTooltipContent>
|
|
42
|
+
</AppTooltip>
|
|
43
|
+
</AppTooltipProvider>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### With keyboard shortcut
|
|
47
|
+
```tsx
|
|
48
|
+
<AppTooltipContent>
|
|
49
|
+
<p className="flex items-center gap-1.5">
|
|
50
|
+
Bold
|
|
51
|
+
<kbd className="pointer-events-none rounded border border-primary-foreground/20 bg-primary-foreground/10 px-1 font-mono text-[10px]">
|
|
52
|
+
⌘B
|
|
53
|
+
</kbd>
|
|
54
|
+
</p>
|
|
55
|
+
</AppTooltipContent>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Tooltip on a disabled button
|
|
59
|
+
```tsx
|
|
60
|
+
<AppTooltipTrigger asChild>
|
|
61
|
+
<span tabIndex={0} className="inline-flex">
|
|
62
|
+
<AppButton variant="outline" disabled>Disabled</AppButton>
|
|
63
|
+
</span>
|
|
64
|
+
</AppTooltipTrigger>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Rules
|
|
68
|
+
- ✅ Always wrap `AppTooltip` in `AppTooltipProvider` (place at app root or layout level)
|
|
69
|
+
- ✅ Use `asChild` on `AppTooltipTrigger` when wrapping an existing interactive element
|
|
70
|
+
- ✅ For disabled buttons: wrap in `<span tabIndex={0}>` so pointer events reach the trigger
|
|
71
|
+
- ✅ Keep tooltip content brief and purely informative
|
|
72
|
+
- ✅ Arrow is rendered automatically — do not add one manually
|
|
73
|
+
- ❌ Do not put interactive elements (buttons, links) inside `AppTooltipContent`
|
|
74
|
+
- ❌ If a prop you need is missing, stop and inform the design team
|
|
75
|
+
|
|
76
|
+
## Responsive
|
|
77
|
+
|
|
78
|
+
`AppTooltipContent` renders `null` on mobile (<768px) because hover does not exist on touch. Every element that uses a tooltip as its only accessible label must also carry an `aria-label` on the trigger so it remains accessible on mobile.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# AppTypography
|
|
2
|
+
|
|
3
|
+
> Docs: https://ui-kit.vercel.app/docs/components/typography
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { AppTypography } from "@skunkworksai/ui-kit"
|
|
7
|
+
import type { AppTypographyVariant } from "@skunkworksai/ui-kit"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `variant` | `AppTypographyVariant` | — | **Required.** Controls visual style and default HTML tag. |
|
|
15
|
+
| `as` | `React.ElementType` | — | Overrides the rendered HTML tag while keeping the variant's styles. |
|
|
16
|
+
| `className` | `string` | — | Additional Tailwind classes merged via `cn()`. |
|
|
17
|
+
|
|
18
|
+
## Variants
|
|
19
|
+
|
|
20
|
+
| Variant | Tag | Notes |
|
|
21
|
+
|---------|-----|-------|
|
|
22
|
+
| `display` | `h1` | Largest heading. For hero/page-level display text. |
|
|
23
|
+
| `h1` | `h1` | Page title. `text-4xl font-extrabold tracking-tight`. |
|
|
24
|
+
| `h2` | `h2` | Section heading. Includes bottom border. |
|
|
25
|
+
| `h3` | `h3` | Subsection heading. |
|
|
26
|
+
| `h4` | `h4` | Label-weight heading. |
|
|
27
|
+
| `p` | `p` | Body paragraph. Adds top margin when not first child. |
|
|
28
|
+
| `lead` | `p` | Large intro text. `text-xl text-muted-foreground`. |
|
|
29
|
+
| `large` | `div` | Semibold large text. Use for callout values. |
|
|
30
|
+
| `small` | `small` | Caption / footnote text. |
|
|
31
|
+
| `muted` | `p` | Secondary / helper text. `text-muted-foreground`. |
|
|
32
|
+
| `mono` | `p` | Monospace text for non-code inline values. |
|
|
33
|
+
| `blockquote` | `blockquote` | Styled block quote with left border. |
|
|
34
|
+
| `code` | `code` | Inline code snippet. Muted background, monospace. |
|
|
35
|
+
| `list` | `ul` | Disc list. Children must be `<li>` elements. |
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
### Headings
|
|
40
|
+
```tsx
|
|
41
|
+
<AppTypography variant="display">Welcome to UI Kit</AppTypography>
|
|
42
|
+
<AppTypography variant="h1">Page Title</AppTypography>
|
|
43
|
+
<AppTypography variant="h2">Section Heading</AppTypography>
|
|
44
|
+
<AppTypography variant="h3">Subsection</AppTypography>
|
|
45
|
+
<AppTypography variant="h4">Label</AppTypography>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Body text
|
|
49
|
+
```tsx
|
|
50
|
+
<AppTypography variant="lead">A short intro sentence that sets context.</AppTypography>
|
|
51
|
+
<AppTypography variant="p">Full paragraph body text with comfortable line height.</AppTypography>
|
|
52
|
+
<AppTypography variant="small">Supplementary detail or caption.</AppTypography>
|
|
53
|
+
<AppTypography variant="muted">Helper text or secondary information.</AppTypography>
|
|
54
|
+
<AppTypography variant="mono">const value = 42</AppTypography>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### List
|
|
58
|
+
```tsx
|
|
59
|
+
<AppTypography variant="list">
|
|
60
|
+
<li>First item</li>
|
|
61
|
+
<li>Second item</li>
|
|
62
|
+
<li>Third item</li>
|
|
63
|
+
</AppTypography>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Override tag with `as` prop
|
|
67
|
+
```tsx
|
|
68
|
+
{/* h2 styles on an h3 element for correct document outline */}
|
|
69
|
+
<AppTypography variant="h2" as="h3">Section Title</AppTypography>
|
|
70
|
+
|
|
71
|
+
{/* p styles inline */}
|
|
72
|
+
<AppTypography variant="p" as="span">Inline text</AppTypography>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Rules
|
|
76
|
+
- ✅ Always use `AppTypography` for all styled text — never raw `<h1>`–`<h4>`, `<p>`, `<blockquote>`, `<code>`
|
|
77
|
+
- ✅ Use `as` when semantic HTML must differ from the visual style
|
|
78
|
+
- ✅ For `list` variant, always use `<li>` children
|
|
79
|
+
- ❌ Never set `font-size`, `font-weight`, or color directly — use the `variant` prop
|
|
80
|
+
- ❌ Never use arbitrary Tailwind type classes (`text-[13px]`) — request a variant instead
|
|
81
|
+
- ❌ If a variant you need is missing, stop and inform the design team
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { cpSync, existsSync } from 'node:fs'
|
|
3
|
+
import { join, resolve } from 'node:path'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
5
|
+
|
|
6
|
+
const pkgRoot = resolve(fileURLToPath(new URL('.', import.meta.url)), '..')
|
|
7
|
+
const cwd = process.cwd()
|
|
8
|
+
|
|
9
|
+
function scaffold(src, dest, label) {
|
|
10
|
+
if (existsSync(dest)) {
|
|
11
|
+
console.log(`[skip] ${label} already exists at ${dest} — delete it first to re-scaffold`)
|
|
12
|
+
return
|
|
13
|
+
}
|
|
14
|
+
cpSync(src, dest, { recursive: true })
|
|
15
|
+
console.log(`[ok] ${label} -> ${dest}`)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
scaffold(
|
|
19
|
+
join(pkgRoot, 'dist', 'tokens-source.css'),
|
|
20
|
+
join(cwd, 'src', 'tokens.css'),
|
|
21
|
+
'tokens.css'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
scaffold(
|
|
25
|
+
join(pkgRoot, 'dist', 'assets'),
|
|
26
|
+
join(cwd, 'src', 'assets'),
|
|
27
|
+
'assets/'
|
|
28
|
+
)
|