@orangecheck/design 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 OrangeCheck
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # @orangecheck/design
2
+
3
+ The OrangeCheck design system — **multi-theme tokens, primitives, and family
4
+ composites** for the `.ochk.io` sub-sites. Tailwind 4 + Next.js Pages Router.
5
+ Family-internal (for embeddable OrangeCheck components see `@orangecheck/react`).
6
+
7
+ Living showcase: **[design.ochk.io](https://design.ochk.io)** (Storybook).
8
+ Canonical design + rollout plan: `~/Projects/ochk/DESIGN-SYSTEM-PLAN.md`.
9
+
10
+ ## What's in the box
11
+
12
+ | Subpath | Contents |
13
+ |---------|----------|
14
+ | `@orangecheck/design` | everything below, re-exported |
15
+ | `@orangecheck/design/tokens` | `OcThemeProvider`, `useOcSkin`, `OcThemePicker`, `getOcThemeInitScript`, `OC_THEMES`, `DEFAULT_OC_THEME`, `cn` |
16
+ | `@orangecheck/design/primitives` | `Button` `Badge` `Input` `Label` `Alert` `Textarea` `ThemeToggle` `Working` `ErrorBoundary` (cva + Radix) |
17
+ | `@orangecheck/design/components` | family composites, re-exported from `@orangecheck/ui` |
18
+ | `@orangecheck/design/styles.css` | token bridge + base layer + utility system + all skin token values |
19
+
20
+ ## Two theme axes
21
+
22
+ - **Mode** — `light | dark`, owned by `next-themes` via the `.dark` class. Toggle
23
+ with `<ThemeToggle />`. Unchanged from today.
24
+ - **Skin** — a named theme (`orangecheck` default, `midnight`, …), owned by
25
+ `<OcThemeProvider>` via the `data-oc-theme` attribute, persisted in the
26
+ `oc_skin` cookie at `Domain=.ochk.io` so a choice carries across every family
27
+ site. Pick with `<OcThemePicker />`.
28
+
29
+ The two compose: any skin renders in both modes.
30
+
31
+ ## Adoption (consumer site)
32
+
33
+ `src/styles/globals.css`:
34
+
35
+ ```css
36
+ @import 'tailwindcss';
37
+ @source '../../node_modules/@orangecheck/ui';
38
+ @source '../../node_modules/@orangecheck/design';
39
+ @import 'tw-animate-css';
40
+ @custom-variant dark (&:is(.dark *));
41
+ @import '@orangecheck/design/styles.css';
42
+ ```
43
+
44
+ `_app.tsx`:
45
+
46
+ ```tsx
47
+ <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
48
+ <OcThemeProvider>
49
+ {/* …app… */}
50
+ </OcThemeProvider>
51
+ </ThemeProvider>
52
+ ```
53
+
54
+ `_document.tsx` `<Head>` (avoids a skin flash before hydration):
55
+
56
+ ```tsx
57
+ <script dangerouslySetInnerHTML={{ __html: getOcThemeInitScript() }} />
58
+ ```
59
+
60
+ Header (gate the picker behind a flag during staged rollout):
61
+
62
+ ```tsx
63
+ <ThemeToggle />
64
+ {process.env.NEXT_PUBLIC_OC_THEME_PICKER === '1' && <OcThemePicker />}
65
+ ```
66
+
67
+ Fonts are still loaded by the app via `next/font` into `--font-sans-display`
68
+ and `--font-mono-display`, exactly as before.
69
+
70
+ ## Adding a skin
71
+
72
+ 1. Add `src/styles/themes/<id>.css` declaring the full token set for both modes
73
+ (under `[data-oc-theme='<id>']` and `[data-oc-theme='<id>'].dark`).
74
+ 2. `@import` it from `src/styles/themes.css`.
75
+ 3. Add a row to `OC_THEMES` in `src/tokens/themes.ts`.
76
+ 4. Publish. Every site picks it up on the next Renovate bump — no per-site edits.
77
+
78
+ ## Build
79
+
80
+ ```
81
+ yarn build # tsup (cjs+esm+dts) + copy CSS to dist/styles
82
+ yarn type-check
83
+ yarn storybook # local showcase
84
+ yarn build-storybook
85
+ ```
86
+
87
+ Published via tag `design-v<x.y.z>` from `oc-packages` (see `release.yml`).
88
+ MIT.
@@ -0,0 +1 @@
1
+ export * from '@orangecheck/ui';
@@ -0,0 +1 @@
1
+ export * from '@orangecheck/ui';
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var ui = require('@orangecheck/ui');
4
+
5
+
6
+
7
+ Object.keys(ui).forEach(function (k) {
8
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
9
+ enumerable: true,
10
+ get: function () { return ui[k]; }
11
+ });
12
+ });
13
+ //# sourceMappingURL=components.js.map
14
+ //# sourceMappingURL=components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"components.js","sourcesContent":[]}
@@ -0,0 +1,3 @@
1
+ export * from '@orangecheck/ui';
2
+ //# sourceMappingURL=components.mjs.map
3
+ //# sourceMappingURL=components.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"components.mjs","sourcesContent":[]}
@@ -0,0 +1,16 @@
1
+ export { DEFAULT_OC_THEME, OC_SKIN_COOKIE, OC_THEMES, OcTheme, OcThemeBridge, OcThemeId, OcThemePicker, OcThemePickerProps, OcThemeProvider, OcThemeProviderProps, cn, getOcThemeInitScript, isKnownTheme, resolveTheme, useOcSkin } from './tokens.mjs';
2
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithActionProps, AlertWithCountdown, AlertWithCountdownProps, Badge, Button, ConfirmHost, ConfirmOptions, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, ErrorBoundary, Input, Label, Modal, ModalProps, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, PromptOptions, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetContent, SheetDescription, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SkeletonProps, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, WorkingProps, badgeVariants, buttonVariants, confirm, prompt } from './primitives.mjs';
3
+ export * from '@orangecheck/ui';
4
+ import 'clsx';
5
+ import 'react/jsx-runtime';
6
+ import 'react';
7
+ import 'class-variance-authority/types';
8
+ import 'class-variance-authority';
9
+ import '@radix-ui/react-label';
10
+ import 'lucide-react';
11
+ import '@radix-ui/react-separator';
12
+ import '@radix-ui/react-dialog';
13
+ import '@radix-ui/react-popover';
14
+ import '@radix-ui/react-accordion';
15
+ import '@radix-ui/react-select';
16
+ import 'sonner';
@@ -0,0 +1,16 @@
1
+ export { DEFAULT_OC_THEME, OC_SKIN_COOKIE, OC_THEMES, OcTheme, OcThemeBridge, OcThemeId, OcThemePicker, OcThemePickerProps, OcThemeProvider, OcThemeProviderProps, cn, getOcThemeInitScript, isKnownTheme, resolveTheme, useOcSkin } from './tokens.js';
2
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithActionProps, AlertWithCountdown, AlertWithCountdownProps, Badge, Button, ConfirmHost, ConfirmOptions, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, ErrorBoundary, Input, Label, Modal, ModalProps, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, PromptOptions, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetContent, SheetDescription, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SkeletonProps, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, WorkingProps, badgeVariants, buttonVariants, confirm, prompt } from './primitives.js';
3
+ export * from '@orangecheck/ui';
4
+ import 'clsx';
5
+ import 'react/jsx-runtime';
6
+ import 'react';
7
+ import 'class-variance-authority/types';
8
+ import 'class-variance-authority';
9
+ import '@radix-ui/react-label';
10
+ import 'lucide-react';
11
+ import '@radix-ui/react-separator';
12
+ import '@radix-ui/react-dialog';
13
+ import '@radix-ui/react-popover';
14
+ import '@radix-ui/react-accordion';
15
+ import '@radix-ui/react-select';
16
+ import 'sonner';