@deriv-ds/design-intelligence-layer 0.2.0 → 0.4.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Trading Game Design System
1
+ # Quill Design System
2
2
 
3
- A component library and design token system for the Trading Game product. Built on [shadcn/ui](https://ui.shadcn.com/) with a custom Figma-driven token architecture, Tailwind CSS v4, and React 19.
3
+ A component library and design token system built on [shadcn/ui](https://ui.shadcn.com/) with a custom Figma-driven token architecture, Tailwind CSS v4, and React 19.
4
4
 
5
5
  Published as **`@deriv-ds/design-intelligence-layer`** on npm.
6
6
 
@@ -11,10 +11,10 @@ Published as **`@deriv-ds/design-intelligence-layer`** on npm.
11
11
  ### Installation
12
12
 
13
13
  ```bash
14
- npm install @deriv-ds/design-intelligence-layer@latest --safe-chain-skip-minimum-package-age
14
+ npm install @deriv-ds/design-intelligence-layer
15
15
  ```
16
16
 
17
- > **Note:** The `--safe-chain-skip-minimum-package-age` flag bypasses npm's 72-hour safe-chain hold on newly published packages. Required when the latest version was published less than 72 hours ago (common for AI agents and CI pipelines).
17
+ > **CI / time-sensitive installs:** If the package was published less than 72 hours ago and npm's safe-chain hold is blocking it, append `--safe-chain-skip-minimum-package-age` to the command above.
18
18
 
19
19
  ### 1. Add the CSS imports
20
20
 
@@ -50,9 +50,9 @@ export default {
50
50
 
51
51
  ### 2. Fonts (handled automatically)
52
52
 
53
- The styles import loads **Plus Jakarta Sans** from Google Fonts automatically. No additional font setup is needed.
53
+ The styles import loads **Inter** from Google Fonts automatically (weights 300–800). No additional font setup is needed.
54
54
 
55
- Use `font-body`, `font-display`, or `font-sans` in your Tailwind classes — all resolve to Plus Jakarta Sans.
55
+ Use `font-body`, `font-display`, or `font-sans` in your Tailwind classes — all resolve to Inter. Use `font-mono` for code (Red Hat Mono).
56
56
 
57
57
  ### 3. Use components
58
58
 
@@ -62,7 +62,7 @@ import { Button, Card, Badge } from "@deriv-ds/design-intelligence-layer"
62
62
  export default function App() {
63
63
  return (
64
64
  <Card>
65
- <Button variant="primary">Trade Now</Button>
65
+ <Button variant="primary">Get Started</Button>
66
66
  <Badge>Live</Badge>
67
67
  </Card>
68
68
  )
@@ -83,11 +83,13 @@ npm install react react-dom tailwindcss
83
83
 
84
84
  ## What's inside
85
85
 
86
- - **54 UI components** — buttons, forms, dialogs, charts, sidebars, and more
87
- - **Design tokens** — CSS custom properties for color, radius, typography, and transitions synced from Figma
88
- - **Transition tokens** — semantic duration and easing tokens (`duration-base`, `ease-standard`, etc.) no hardcoded `duration-200` anywhere
89
- - **Light-only theme** — white backgrounds, black text, primary blue accents no dark mode
90
- - **Typography classes** — heading scale (h1–xs) and body scale (lg–xs) ready to use
86
+ - **61 UI components** — buttons, forms, dialogs, charts, sidebars, and more
87
+ - **Design tokens** — three-layer architecture (primitives foundation semantics component tokens) synced from Figma
88
+ - **Light + Dark themes** — toggle `.dark` on `<html>` to switch; every semantic token has a paired override
89
+ - **Inter typography** — heading (mega h6) and body (xl xs) scales ready to use
90
+ - **17 colour ramps** — slate, blue, sapphire, blueberry, grape, magenta, cherry, coral, red, orange, yellow, mustard, green, emerald, tiffany, teal, seawater
91
+ - **Transition tokens** — semantic duration (`duration-fast`, `duration-base`, etc.) and easing (`ease-standard`, `ease-enter`, etc.) — no hardcoded `duration-200`
92
+ - **Elevation scale** — five composed `box-shadow` shorthands (`--elevation-100` through `--elevation-500`) that auto-adapt to the active theme
91
93
  - **TypeScript** — full type definitions included
92
94
  - **ESM + CJS** — works with any bundler
93
95
 
@@ -98,10 +100,9 @@ npm install react react-dom tailwindcss
98
100
  | Component | Import |
99
101
  |---|---|
100
102
  | Accordion | `Accordion, AccordionItem, AccordionTrigger, AccordionContent` |
101
- | Alert | `Alert, AlertTitle, AlertDescription` |
102
- | Alert Dialog | `AlertDialog, AlertDialogTrigger, AlertDialogContent, ...` |
103
+ | Aspect Ratio | `AspectRatio` |
103
104
  | Avatar | `Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup` |
104
- | Badge | `Badge, badgeVariants` |
105
+ | Badge | `Badge, BadgeDot` |
105
106
  | Breadcrumb | `Breadcrumb, BreadcrumbList, BreadcrumbItem, ...` |
106
107
  | Button | `Button, buttonVariants` |
107
108
  | Calendar | `Calendar, CalendarDayButton` |
@@ -109,12 +110,14 @@ npm install react react-dom tailwindcss
109
110
  | Carousel | `Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext` |
110
111
  | Chart | `ChartContainer, ChartTooltip, ChartLegend, ChartStyle` |
111
112
  | Checkbox | `Checkbox` |
113
+ | Chip | `Chip, chipVariants` |
112
114
  | Collapsible | `Collapsible, CollapsibleTrigger, CollapsibleContent` |
113
115
  | Combobox | `Combobox, ComboboxInput, ComboboxContent, ComboboxItem, ...` |
114
116
  | Command | `Command, CommandDialog, CommandInput, CommandList, ...` |
115
117
  | Context Menu | `ContextMenu, ContextMenuTrigger, ContextMenuContent, ...` |
116
118
  | Dialog | `Dialog, DialogTrigger, DialogContent, DialogHeader, ...` |
117
- | Drawer | `Drawer, DrawerTrigger, DrawerContent, DrawerHeader, ...` |
119
+ | Direction | `DirectionProvider, useDirection` |
120
+ | Drawer | `Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, DrawerClose` |
118
121
  | Dropdown Menu | `DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, ...` |
119
122
  | Empty State | `Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent` |
120
123
  | Field | `Field, FieldLabel, FieldDescription, FieldError, FieldGroup` |
@@ -122,33 +125,40 @@ npm install react react-dom tailwindcss
122
125
  | Hover Card | `HoverCard, HoverCardTrigger, HoverCardContent` |
123
126
  | Input | `Input` |
124
127
  | Input Group | `InputGroup, InputGroupAddon, InputGroupButton, InputGroupText` |
125
- | Input OTP | `InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator` |
126
128
  | Item | `Item, ItemMedia, ItemContent, ItemTitle, ItemDescription` |
127
129
  | Kbd | `Kbd, KbdGroup` |
128
130
  | Label | `Label` |
129
131
  | Link | `Link` |
130
- | Menubar | `Menubar, MenubarMenu, MenubarTrigger, MenubarContent, ...` |
132
+ | Loading Spinner | `LoadingSpinner` |
133
+ | Modal | `AlertDialog, AlertDialogTrigger, AlertDialogContent, ...` |
131
134
  | Native Select | `NativeSelect, NativeSelectOptGroup, NativeSelectOption` |
132
135
  | Navigation Menu | `NavigationMenu, NavigationMenuList, NavigationMenuTrigger, ...` |
136
+ | Notification | `NotificationBanner, NotificationItem, NotificationDivider` |
137
+ | OTP Field | `CodeInput, CodeInputGroup, CodeInputSlot, CodeInputSeparator` |
133
138
  | Pagination | `Pagination, PaginationContent, PaginationLink, ...` |
134
139
  | Popover | `Popover, PopoverTrigger, PopoverContent, PopoverAnchor` |
135
140
  | Progress | `Progress` |
136
141
  | Radio Group | `RadioGroup, RadioGroupItem` |
137
142
  | Resizable | `ResizableHandle, ResizablePanel, ResizablePanelGroup` |
138
143
  | Scroll Area | `ScrollArea, ScrollBar` |
144
+ | Search Field | `SearchField, searchFieldVariants` |
145
+ | Section Message | `SectionMessage, SectionMessageTitle, SectionMessageDescription` |
146
+ | Segmented Control | `SegmentedControl, SegmentedControlList, SegmentedControlTrigger, SegmentedControlContent` |
139
147
  | Select | `Select, SelectTrigger, SelectContent, SelectItem, ...` |
140
148
  | Separator | `Separator` |
141
149
  | Sheet | `Sheet, SheetTrigger, SheetContent, SheetHeader, ...` |
142
150
  | Sidebar | `Sidebar, SidebarProvider, SidebarMenu, SidebarMenuItem, ...` |
143
151
  | Skeleton | `Skeleton` |
144
152
  | Slider | `Slider` |
153
+ | Snackbar | `Snackbar` |
145
154
  | Spinner | `Spinner` |
155
+ | Stepper | `Stepper` |
146
156
  | Switch | `Switch` |
157
+ | Tab | `Tab, TabList, TabTrigger, TabContent` |
147
158
  | Table | `Table, TableHeader, TableBody, TableRow, TableHead, TableCell` |
148
159
  | Tabs | `Tabs, TabsList, TabsTrigger, TabsContent` |
160
+ | Tag | `Tag, tagVariants` |
149
161
  | Textarea | `Textarea` |
150
- | Ticket Card | `TicketCard` |
151
- | Toast | `Toaster` |
152
162
  | Toggle | `Toggle, toggleVariants` |
153
163
  | Toggle Group | `ToggleGroup, ToggleGroupItem` |
154
164
  | Tooltip | `Tooltip, TooltipTrigger, TooltipContent, TooltipProvider` |
@@ -157,7 +167,7 @@ npm install react react-dom tailwindcss
157
167
 
158
168
  ## Blocks
159
169
 
160
- Blocks are pre-composed UI patterns built from design system primitives. They are demonstrated in the **Blocks** tab of the development playground and are **not** exported from the npm package — import the underlying components directly if you need to use them.
170
+ Blocks are pre-composed UI patterns built from Quill primitives. They are demonstrated in the **Blocks** tab of the development playground and are **not** exported from the npm package — import the underlying components directly if you need to use them.
161
171
 
162
172
  | Block | Variants | Description |
163
173
  |---|---|---|
@@ -168,54 +178,85 @@ Blocks are pre-composed UI patterns built from design system primitives. They ar
168
178
 
169
179
  ## Button variants and sizes
170
180
 
181
+ The brand colour is **coral `#FF444F`** (`--primitive-coral-700`). Hover darkens to `#E12E3A` (coral-800), pressed to `#C41C28` (coral-900).
182
+
171
183
  ```tsx
172
- <Button variant="primary" /> // Blue filled (#2323FF) — main CTA
173
- <Button variant="secondary" /> // Black outline — secondary actions
174
- <Button variant="tertiary" /> // Text only, underline on hover minimal
184
+ <Button variant="primary" /> // Coral filled (#FF444F) — main CTA, white text
185
+ <Button variant="secondary" /> // 1.5px outline (slate-1200 / white in dark) — secondary actions
186
+ <Button variant="tertiary" /> // Filled neutral surface (slate-100 / slate-1000 in dark)
187
+ <Button variant="ghost" /> // Transparent, hover tint only
188
+
189
+ // Theme tone modifiers (per variant): normal · inverse · static-light · static-dark
190
+ // e.g. <Button variant="primary" tone="static-light" />
191
+
192
+ // Sizes (height · font-size · min-width)
193
+ <Button size="lg" /> // 48px · 18px · 96px min, 20px padding-x
194
+ <Button size="md" /> // 40px · 16px · 80px min, 16px padding-x (default)
195
+ <Button size="sm" /> // 32px · 14px · 64px min, 12px padding-x
196
+
197
+ // Icon-only sizes (square)
198
+ <Button size="icon-lg" /> // 48 × 48 — icon 24px
199
+ <Button size="icon-md" /> // 40 × 40 — icon 20px
200
+ <Button size="icon-sm" /> // 32 × 32 — icon 16px
201
+ ```
202
+
203
+ All sizes use a fully pill-shaped border (`border-radius: 999px`).
204
+
205
+ ## Badge variants
206
+
207
+ ```tsx
208
+ // Status fills (solid backgrounds, white text)
209
+ <Badge variant="number" /> // Red (#C40000 light · #FF4D4D dark)
210
+ <Badge variant="red" /> // Status red
211
+ <Badge variant="yellow" /> // Status yellow (#C47D00 / #FFBE4D)
212
+ <Badge variant="green" /> // Status green (#007A22 / #4DBC6B)
213
+ <Badge variant="blue" /> // Status info blue (#0777C4 / #53B9FF)
175
214
 
176
215
  // Sizes
177
- <Button size="lg" /> // 48px height (default)
178
- <Button size="md" /> // 40px height
179
- <Button size="sm" /> // 32px height
180
- <Button size="xs" /> // 24px height
181
- <Button size="icon-lg" /> // 48px square
182
- <Button size="icon-md" /> // 40px square
183
- <Button size="icon-sm" /> // 28px square
184
- <Button size="icon-xs" /> // 24px square
216
+ <Badge size="sm" /> // 20px height · 12px font · 8px dot
217
+ <Badge size="md" /> // 24px height · 14px font · 16px dot
185
218
  ```
186
219
 
187
- ## Badge variants
220
+ Badges are pill-shaped (`border-radius: 999px`).
221
+
222
+ ## Tag variants
223
+
224
+ Tags are 4px-radius chips for filtering, metadata, and categorisation. Two visual styles — outline and fill — across five tones.
188
225
 
189
226
  ```tsx
190
- // Default (solid)
191
- <Badge variant="default" /> // Blue (#2323FF)
192
- <Badge variant="default-success" /> // Green
193
- <Badge variant="default-fail" /> // Red
227
+ <Tag tone="neutral" /> // slate (default)
228
+ <Tag tone="red" />
229
+ <Tag tone="yellow" />
230
+ <Tag tone="green" />
231
+ <Tag tone="blue" />
232
+
233
+ <Tag variant="outline" /> // border + text, transparent fill
234
+ <Tag variant="fill" /> // tinted background (red @ 8%, etc.)
194
235
 
195
- // Fill (tint background)
196
- <Badge variant="fill" /> // Blue tint
197
- <Badge variant="fill-success" /> // Green tint
198
- <Badge variant="fill-fail" /> // Red tint
236
+ // Sizes
237
+ <Tag size="sm" /> // 24px · 12px font · 16px icon · 4px gap
238
+ <Tag size="md" /> // 32px · 14px font · 18px icon · 8px gap
239
+ ```
199
240
 
200
- // Outline (black border, secondary-hover on hover)
201
- <Badge variant="outline" />
241
+ ## Section message variants
202
242
 
203
- // Ghost (transparent)
204
- <Badge variant="ghost" />
205
- <Badge variant="ghost-success" />
206
- <Badge variant="ghost-fail" />
243
+ ```tsx
244
+ <SectionMessage variant="default" /> // Neutral grey tint
245
+ <SectionMessage variant="information" /> // Blue tint + info icon
246
+ <SectionMessage variant="success" /> // Green tint + check icon
247
+ <SectionMessage variant="warning" /> // Yellow tint + alert icon
248
+ <SectionMessage variant="danger" /> // Red tint + danger icon
207
249
 
208
250
  // Sizes
209
- <Badge size="sm" /> // 24px height
210
- <Badge size="md" /> // 32px height (default)
211
- <Badge size="lg" /> // 40px height
251
+ <SectionMessage size="sm" /> // 14px message · 16px title · 20px icon
252
+ <SectionMessage size="md" /> // 16px message · 18px title · 22px icon
212
253
  ```
213
254
 
214
255
  ## Alert variants
215
256
 
216
257
  ```tsx
217
- <Alert variant="info" /> // blue — informational (default)
218
- <Alert variant="error" /> // red — error state
258
+ <Alert variant="info" /> // blue (#0777C4 / #53B9FF) — informational (default)
259
+ <Alert variant="error" /> // red (#C40000 / #FF4D4D) — error state
219
260
  ```
220
261
 
221
262
  ## Component behaviour notes
@@ -231,6 +272,18 @@ Blocks are pre-composed UI patterns built from design system primitives. They ar
231
272
  ### Drawer — footer buttons
232
273
  `DrawerFooter` makes all direct child buttons fill the full width automatically via `[&>*]:w-full`. Stack your buttons inside `DrawerFooter` and they will always be full-width.
233
274
 
275
+ ### Drawer — handle bar (bottom direction)
276
+ When `direction="bottom"`, `DrawerContent` renders a handle bar at the top that follows the `component-bottom-sheet` design tokens:
277
+
278
+ | Property | Token | Value |
279
+ |---|---|---|
280
+ | Container height | `--bottom-sheet-size-height-handle-container` | 32px |
281
+ | Container bg (default) | `--bottom-sheet-bg-handle-default` | `slate-50` / `slate-1100` |
282
+ | Bar height | `--bottom-sheet-size-height-handle-bar` | 4px |
283
+ | Bar width | `--bottom-sheet-size-width-handle-bar` | 40px |
284
+ | Bar color | `--bottom-sheet-bg-handle-bar` | `black-alpha-300` / `white-alpha-300` |
285
+ | Bar radius | `--bottom-sheet-size-radius-handle-bar` | 999 (pill) |
286
+
234
287
  ### Link — size lg
235
288
  The `lg` variant of `Link` uses `text-base` (16px). The `md` and `sm` variants use `text-sm` (14px) and `text-xs` (12px) respectively.
236
289
 
@@ -241,54 +294,197 @@ The `lg` variant of `Link` uses `text-base` (16px). The `md` and `sm` variants u
241
294
  ```
242
295
 
243
296
  ### Tabs — line variant hover
244
- On the `line` variant, hover state shows `text-primary` (blue) with no background fill. On the `default` (pill) variant, hover shows a grey background with `text-on-prominent`.
297
+ On the `line` variant, hover state shows `text-utility-brand` (coral `#FF444F`) with no background fill. On the `default` (pill) variant, hover shows a slate-tinted background with `text-prominent`.
298
+
299
+ Tab sizes:
300
+
301
+ | Size | Min height | Min width | Padding-x | Font size |
302
+ |---|---|---|---|---|
303
+ | `sm` | 32px | 72px | 12px | 14px |
304
+ | `md` | 40px | 80px | 16px | 16px |
305
+ | `lg` | 48px | 96px | 20px | 18px |
245
306
 
246
307
  ---
247
308
 
248
309
  ## Design tokens
249
310
 
250
- All tokens are CSS custom properties, loaded automatically via `@deriv-ds/design-intelligence-layer/styles`.
311
+ All tokens are CSS custom properties, loaded automatically via `@deriv-ds/design-intelligence-layer/styles`. Tokens follow a three-layer architecture:
312
+
313
+ 1. **Primitives** (`--primitive-*`) — raw colour ramps, alpha scales, durations, easings. Never reference directly.
314
+ 2. **Foundation semantics** (`--background-*`, `--text-*`, `--border-*`, `--icon-*`, `--elevation-*`) — paired between `:root` (light) and `.dark` (dark).
315
+ 3. **Component tokens** (`--button-*`, `--field-*`, `--tag-*`, `--badge-*`, etc.) — derived from foundation semantics.
316
+
317
+ ### Theme switching
318
+
319
+ Toggle dark mode by adding `.dark` to the `<html>` element:
320
+
321
+ ```html
322
+ <html class="dark"> <!-- or remove .dark for light mode -->
323
+ ```
324
+
325
+ Every semantic token has a paired light/dark value, so component code never needs theme-aware conditionals.
251
326
 
252
327
  ### Background tokens
253
328
 
254
- | Tailwind class | CSS variable | Value | Usage |
329
+ | Tailwind class | CSS variable | Light | Dark | Usage |
330
+ |---|---|---|---|---|
331
+ | `bg-primary-canvas` | `--background-primary-canvas` | `#F6F7F8` | `#181C25` | Page / app canvas |
332
+ | `bg-secondary-canvas` | `--background-secondary-canvas` | `#FFFFFF` | `#181C25` | Alternate canvas |
333
+ | `bg-primary-surface` | `--background-primary-surface` | `#FFFFFF` | `#20242F` | Cards, panels, default surface |
334
+ | `bg-secondary-surface` | `--background-secondary-surface` | `#F6F7F8` | `#20242F` | Subtle / nested surface |
335
+ | `bg-overlay` | `--overlay` | black 50% | black 50% | Modal / dialog / drawer backdrop |
336
+ | `bg-tabs` | `--tabs` | slate @ 4% | white @ 4% | Tab container background (`variant="default"`) |
337
+ | `bg-tabs-active` | `--tabs-active` | `#FFFFFF` | `#11141B` | Active / selected tab pill |
338
+ | `bg-primary` | `--primary` | `#FF444F` | `#FF444F` | Brand coral — CTAs (same in both themes) |
339
+ | `bg-primary-hover` | `--primary-hover` | `#E12E3A` | `#E12E3A` | Primary button hover (coral-800) |
340
+ | `bg-secondary-hover` | `--secondary-hover` | secondary-surface | secondary-surface | Outline / secondary hover tint |
341
+ | `bg-slider-range` | `--slider-range` | coral @ 40% | coral @ 40% | Slider filled range |
342
+
343
+ #### Status backgrounds (24% tints)
344
+
345
+ | Tailwind class | Light | Dark | Usage |
255
346
  |---|---|---|---|
256
- | `bg-prominent` | `--prominent` | `#FFFFFF` | Page background |
257
- | `bg-card` | `--card` | `#FFFFFF` | Card/panel surface |
258
- | `bg-popover` | `--popover` | `#FFFFFF` | Popover/dropdown surface |
259
- | `bg-subtle` | `--subtle` | `#F5F5F5` | Subtle tinted surface |
260
- | `bg-overlay` | `--overlay` | black 50% | Modal/dialog backdrop only |
261
- | `bg-tabs` | `--tabs` | black 4% alpha | Tab container background (`variant="default"`) |
262
- | `bg-tabs-active` | `--tabs-active` | `#FFFFFF` | Active / selected tab pill |
263
- | `bg-primary` | `--primary` | `#2323FF` | Brand blue — CTAs |
264
- | `bg-primary-hover` | `--primary-hover` | `#0B0BD2` | Primary button hover (darker blue) |
265
- | `bg-secondary-hover` | `--secondary-hover` | `#EEEEEE` | Outline/secondary hover (light grey) |
266
- | `bg-semantic-win` | `--semantic-win` | green | Profit / positive state |
267
- | `bg-semantic-loss` | `--semantic-loss` | red | Loss / negative state |
347
+ | `bg-success-default` | green @ 24% | green @ 24% | Positive / win state surface |
348
+ | `bg-error-default` | red @ 24% | red @ 24% | Negative / loss state surface |
349
+ | `bg-warning-default` | yellow @ 24% | yellow @ 24% | Caution surface |
350
+ | `bg-information-default` | blue @ 24% | blue @ 24% | Informational surface |
351
+
352
+ #### Interaction tints (state layers)
353
+
354
+ | Tailwind class | Light | Dark | Usage |
355
+ |---|---|---|---|
356
+ | `bg-hover-default` | slate @ 8% | white @ 8% | Hover state layer |
357
+ | `bg-pressed-default` | slate @ 16% | white @ 16% | Pressed state layer |
358
+ | `bg-selected-default` | slate @ 8% | white @ 8% | Selected state layer |
359
+
360
+ > Each interaction tint also ships in `inverse`, `static-light`, and `static-dark` flavours (e.g. `bg-hover-static-light`) for placement on themed surfaces.
268
361
 
269
362
  ### Text tokens
270
363
 
271
- | Tailwind class | Value | Usage |
364
+ | Tailwind class | Light | Dark | Usage |
365
+ |---|---|---|---|
366
+ | `text-prominent` | `#181C25` | `#FFFFFF` | Primary on-canvas text |
367
+ | `text-subtle` | slate @ 48% | white @ 48% | Secondary / supporting text |
368
+ | `text-disabled-default` | slate @ 16% | white @ 16% | Disabled labels |
369
+ | `text-prominent-inverse` | `#FFFFFF` | `#181C25` | Text on inverse surfaces |
370
+ | `text-prominent-static-dark` | `#FFFFFF` | `#FFFFFF` | Always white (text on coloured fills) |
371
+ | `text-prominent-static-light` | `#181C25` | `#181C25` | Always slate (text on light fills) |
372
+
373
+ #### Status text
374
+
375
+ | Tailwind class | Light | Dark | Usage |
376
+ |---|---|---|---|
377
+ | `text-success-default` | `#007A22` | `#4DBC6B` | Profit / positive |
378
+ | `text-error-default` | `#C40000` | `#FF4D4D` | Loss / negative |
379
+ | `text-warning-default` | `#C47D00` | `#FFBE4D` | Caution |
380
+ | `text-information-default` | `#0777C4` | `#53B9FF` | Informational |
381
+
382
+ #### Utility text (brand & account modes)
383
+
384
+ | Tailwind class | Value (both themes) | Usage |
272
385
  |---|---|---|
273
- | `text-on-prominent` | `#000000` | Primary text on light backgrounds |
274
- | `text-on-prominent-static-inverse` | `#FFFFFF` | Always white — for text on dark/primary backgrounds |
275
- | `text-on-subtle` | mid grey | Secondary / supporting text |
386
+ | `text-utility-brand` | `#FF444F` (coral-700) | Brand-tinted inline text |
387
+ | `text-utility-real` | `#00C390` (emerald-700) | Real-account indicator |
388
+ | `text-utility-demo` | `#F55F0A` (orange-700) | Demo-account indicator |
389
+
390
+ > The `*-inverse`, `*-static-light`, and `*-static-dark` variants exist for every status token and follow the same theme-pairing rules as `text-prominent`.
391
+
392
+ ### Border tokens
276
393
 
277
- | `text-primary` | `#2323FF` | Brand blue inline text |
278
- | `text-semantic-win` | green | Profit / positive text |
279
- | `text-semantic-loss` | red | Loss / negative text |
394
+ | Tailwind class | CSS variable | Light | Dark | Usage |
395
+ |---|---|---|---|---|
396
+ | `border-default` | `--border-default-default` | slate @ 16% | white @ 16% | Default global border (used by `*` selector) |
397
+ | `border-subtle-default` | `--border-subtle-default` | slate @ 8% | white @ 8% | Cards, dividers, panels |
398
+ | `border-prominent-default` | `--border-prominent-default` | slate @ 16% | white @ 16% | Heavier dividers |
399
+ | `border-selected` | `--border-selected-default` | `#181C25` | `#FFFFFF` | Selected state borders (chip, list-item) |
400
+ | `border-disabled-default` | `--border-disabled-default` | slate @ 8% | white @ 8% | Disabled component borders |
401
+ | `border-input` | `--input` | slate @ 8% | white @ 8% | Input field borders (alias of border-subtle) |
402
+ | `border-border` | `--border` | slate @ 8% | white @ 8% | @deprecated alias — prefer `border-subtle-default` |
403
+ | `ring-ring` | `--ring` | `#FF444F` | `#FF444F` | Focus rings (brand coral) |
280
404
 
281
- ### Border & focus tokens
405
+ #### Status borders
406
+
407
+ | Tailwind class | Light | Dark |
408
+ |---|---|---|
409
+ | `border-success-default` | `#007A22` | `#4DBC6B` |
410
+ | `border-error-default` | `#C40000` | `#FF4D4D` |
411
+ | `border-warning-default` | `#C47D00` | `#FFBE4D` |
412
+ | `border-information-default` | `#0777C4` | `#53B9FF` |
282
413
 
283
- | Tailwind class | CSS variable | Value | Usage |
414
+ > ⚠️ **`border-border` is deprecated.** It now aliases `--border-subtle-default` for backward compatibility. Prefer `border-subtle-default` in all new code.
415
+
416
+ ### Icon tokens
417
+
418
+ Icons follow the same `prominent / subtle / disabled / status / utility` taxonomy as text:
419
+
420
+ | Tailwind class | Light | Dark | Usage |
284
421
  |---|---|---|---|
285
- | `border-border-subtle` | `--border-subtle` | `#EEEEEE` | **Default** cards, dividers, form borders |
286
- | `border-border-prominent` | `--border-prominent` | `#000000` | Outline variant components (button, badge, toggle) |
287
- | `border-border` | `--border` | `#EEEEEE` | @deprecated alias prefer `border-border-subtle` |
288
- | `border-input` | `--input` | `#EEEEEE` | Input field borders |
289
- | `ring-ring` | `--ring` | `#2323FF` | Focus rings |
422
+ | `text-icon-prominent` (via `--icon-prominent-default`) | `#181C25` | `#FFFFFF` | Default icon colour |
423
+ | `text-icon-subtle` | slate @ 48% | white @ 48% | Secondary icons |
424
+ | `text-icon-disabled` | slate @ 16% | white @ 16% | Disabled icons |
425
+ | `text-icon-success` | `#007A22` | `#4DBC6B` | Success icons |
426
+ | `text-icon-error` | `#C40000` | `#FF4D4D` | Error icons |
427
+ | `text-icon-warning` | `#C47D00` | `#FFBE4D` | Warning icons |
428
+ | `text-icon-information` | `#0777C4` | `#53B9FF` | Info icons |
429
+ | `text-icon-utility-brand` | `#FF444F` | `#FF444F` | Brand-tinted icon |
430
+ | `text-icon-utility-real` | `#00C390` | `#00C390` | Real-account icon |
431
+ | `text-icon-utility-demo` | `#F55F0A` | `#F55F0A` | Demo-account icon |
432
+
433
+ Icon component sizes:
434
+
435
+ | Size | Width × height | Flag width × height |
436
+ |---|---|---|
437
+ | `sm` | 16 × 16 | 24 × 16 |
438
+ | `md` | 20 × 20 | 30 × 20 |
439
+ | `lg` | 24 × 24 | 36 × 24 |
440
+
441
+ ### Elevation tokens
442
+
443
+ Five composed `box-shadow` shorthands. Defined once in `:root` — `.dark` swaps only the layer colours, so a single `--elevation-*` reference works in both themes.
444
+
445
+ | Token | Layer 1 (y / blur) | Layer 2 | Layer 3 | Used for |
446
+ |---|---|---|---|---|
447
+ | `--elevation-100` | 1 / 2 | — | — | Base raise (chips, segmented control segments) |
448
+ | `--elevation-200` | 1 / 2 | 2 / 6 | — | Inputs, low cards |
449
+ | `--elevation-300` | 1 / 2 | 4 / 12 | 8 / 24 | Menus, tooltips, popovers |
450
+ | `--elevation-400` | 2 / 4 | 8 / 24 | 16 / 48 | Notifications, snackbars, banner |
451
+ | `--elevation-500` | 4 / 8 | 16 / 48 | 32 / 96 | Bottom sheets, dialogs |
452
+
453
+ Layer colours: black @ 4% / 8% (light) → black @ 8% / 16% (dark).
454
+
455
+ ### Spacing scale
456
+
457
+ | Token | Value (px) | Token | Value (px) |
458
+ |---|---|---|---|
459
+ | `spacing-0` | 0 | `spacing-16` | 16 |
460
+ | `spacing-1` | 1 | `spacing-20` | 20 |
461
+ | `spacing-1-5` | 1.5 | `spacing-24` | 24 |
462
+ | `spacing-2` | 2 | `spacing-32` | 32 |
463
+ | `spacing-4` | 4 | `spacing-40` | 40 |
464
+ | `spacing-6` | 6 | `spacing-48` | 48 |
465
+ | `spacing-7` | 7 | `spacing-56` | 56 |
466
+ | `spacing-8` | 8 | `spacing-64` | 64 |
467
+ | `spacing-12` | 12 | `spacing-72` | 72 |
468
+ | `spacing-14` | 14 | `spacing-80` | 80 |
469
+
470
+ ### Radius scale
471
+
472
+ | Token | Value | Used for |
473
+ |---|---|---|
474
+ | `radius-0` | 0px | Sharp edges |
475
+ | `radius-4` | 4px | Tags, tabs |
476
+ | `radius-8` | 8px | Inputs, fields, cards (default) |
477
+ | `radius-12` | 12px | Mid-tier surfaces |
478
+ | `radius-16` | 16px | Section messages, notifications, bottom sheets |
479
+ | `radius-24` | 24px | Bottom sheet handles |
480
+ | `radius-48` | 48px | Large feature blocks |
481
+ | `radius-999` | 999px | Pills — buttons, badges, chips, segmented control |
290
482
 
291
- > ⚠️ **`border-border` vs `border-border-subtle`:** Both resolve to the same light grey `#EEEEEE`. `border-border` is kept for backward compatibility. **Prefer `border-border-subtle` in all new code.**
483
+ ### Border-width scale
484
+
485
+ `border-0` (0) · `border-1` (1) · `border-1-5` (1.5) · `border-2` (2) · `border-4` (4) · `border-8` (8)
486
+
487
+ > 1.5px is the standard for selected / focused outlines (chips, list-item, segmented control segments, tabs).
292
488
 
293
489
  ### Transition tokens
294
490
 
@@ -301,6 +497,7 @@ Duration — primitive scale:
301
497
  | `duration-base` | `--primitive-duration-base` | `200ms` | Dropdowns, popovers, accordions |
302
498
  | `duration-slow` | `--primitive-duration-slow` | `300ms` | Dialogs, sheets, drawers closing |
303
499
  | `duration-open` | `--primitive-duration-open` | `500ms` | Sheets, drawers entering |
500
+ | `duration-blink` | `--primitive-duration-blink` | `1000ms` | OTP caret blink |
304
501
 
305
502
  Easing — primitive scale:
306
503
 
@@ -313,74 +510,87 @@ Easing — primitive scale:
313
510
 
314
511
  > Always use token utilities — never raw `duration-200` or `ease-in-out` directly.
315
512
 
316
- ### Other tokens
317
-
318
- | Tailwind class | Value | Usage |
319
- |---|---|---|
320
- | `bg-slider-range` | blue 40% | Slider filled range |
321
- | `rounded-lg` | `0.625rem` | Base border radius |
322
-
323
513
  ### Using opacity with tokens
324
514
 
325
515
  Opacity on tokens is allowed and encouraged:
326
516
 
327
517
  ```
328
- ✅ bg-primary/20 blue at 20% opacity
329
- ✅ border-border-subtle/50 → light grey border at 50% opacity
330
- ✅ ring-ring/10 → ring at 10% opacity
518
+ ✅ bg-primary/20 coral at 20% opacity
519
+ ✅ border-subtle-default/50 → subtle border at 50% opacity
520
+ ✅ ring-ring/10 focus ring at 10% opacity
331
521
 
332
- ❌ bg-black/50 → NOT a token, use bg-overlay instead
333
- ❌ bg-white → NOT a token, use bg-prominent or bg-card
522
+ ❌ bg-black/50 → NOT a token, use bg-overlay instead
523
+ ❌ bg-white → NOT a token, use bg-primary-surface or bg-secondary-canvas
334
524
  ```
335
525
 
336
- ### Primitive alpha scales
526
+ ### Primitive colour ramps
337
527
 
338
- For structured alpha surfaces, the design system ships two internal alpha primitive scales. These are **CSS variables only** not exposed as Tailwind utility classes. Always reference them via a semantic token, never directly in components.
528
+ The system ships **17 colour ramps**. Each ramp has solid stops 100 1300 (slate adds 50, 75, 1400) and an opacity scale 50 → 1100. Reference these only via semantic or component tokens — never in product code.
339
529
 
340
- ```
341
- --primitive-mono-alpha-4 through --primitive-mono-alpha-80 (black at N%)
342
- --primitive-blue-alpha-4 through --primitive-blue-alpha-80 (brand blue at N%)
343
- Stops: 4 · 8 · 16 · 24 · 32 · 40 · 50 · 64 · 80
344
- ```
345
-
346
- Example how `--tabs` uses the alpha scale:
347
- ```css
348
- --tabs: var(--primitive-mono-alpha-4); /* black at 4% tab container background */
349
- ```
350
-
351
- > `--primitive-black-50` is deprecated. It now aliases `--primitive-mono-alpha-50`. The `--overlay` semantic token is unaffected.
530
+ | Ramp | 700 (mid / brand stop) | Notes |
531
+ |---|---|---|
532
+ | `slate` | `#414652` | Neutral / surface scale (50 1400) |
533
+ | `red` | `#E6190E` | Error / danger |
534
+ | `orange` | `#F55F0A` | Demo-account utility |
535
+ | `yellow` | `#FF9C13` | Warning |
536
+ | `mustard` | `#F7C60B` | Decorative warm |
537
+ | `green` | `#008832` | Success |
538
+ | `emerald` | `#00C390` | Real-account utility |
539
+ | `tiffany` | `#17EABD` | Decorative |
540
+ | `teal` | `#00CCCC` | Decorative |
541
+ | `seawater` | `#0AA0B0` | Decorative |
542
+ | `blue` | `#2C9AFF` | Information |
543
+ | `sapphire` | `#0C28F7` | Decorative |
544
+ | `blueberry` | `#4902E0` | Decorative |
545
+ | `grape` | `#7F0DCF` | Decorative |
546
+ | `magenta` | `#CB0DF7` | Decorative |
547
+ | `cherry` | `#DE0040` | Decorative |
548
+ | `coral` | `#FF444F` | **Brand primary** |
549
+
550
+ Opacity scale stops (per ramp): `50 · 75 · 100 · 200 · 300 · 400 · 500 · 600 · 700 · 800 · 900 · 1000 · 1100`
551
+ → alpha values: `0% · 4% · 8% · 16% · 24% · 32% · 40% · 48% · 56% · 64% · 72% · 80% · 88%`
552
+
553
+ White and black opacity scales follow the same stops.
352
554
 
353
555
  ---
354
556
 
355
557
  ## Typography
356
558
 
357
- The styles export includes pre-built typography classes using **Plus Jakarta Sans**.
358
-
359
- ### Heading scale (Semibold 600 · tracking 1.5px · uppercase)
559
+ The styles export includes pre-built typography classes using **Inter** (loaded from Google Fonts, weights 300–800).
360
560
 
361
- | Class | Size / Line height |
362
- |---|---|
363
- | `heading-h1` | 72px / 72px |
364
- | `heading-h2` | 64px / 64px |
365
- | `heading-h3` | 48px / 48px |
366
- | `heading-h4` | 40px / 40px |
367
- | `heading-xs` | 24px / 24px |
561
+ ### Heading scale (Inter · ExtraBold 800 · letter-spacing −0.02em)
368
562
 
369
- ### Body scale (Semibold 600)
563
+ | Class | Font size | Line height |
564
+ |---|---|---|
565
+ | `heading-mega` | 72px | 72px |
566
+ | `heading-hero` | 64px | 64px |
567
+ | `heading-h1` | 56px | 56px |
568
+ | `heading-h2` | 40px | 40px |
569
+ | `heading-h3` | 32px | 32px |
570
+ | `heading-h4` | 24px | 24px |
571
+ | `heading-h5` | 20px | 20px |
572
+ | `heading-h6` | 16px | 16px |
573
+ | `heading-xs` | 24px | 24px | (@deprecated — use `heading-h4`)
574
+
575
+ ### Body scale (Inter · Regular 400)
576
+
577
+ | Class | Font size | Line height |
578
+ |---|---|---|
579
+ | `body-xl` | 20px | 30px |
580
+ | `body-lg` | 18px | 27px |
581
+ | `body-md` | 16px | 24px |
582
+ | `body-sm` | 14px | 21px |
583
+ | `body-xs` | 12px | 18px |
370
584
 
371
- | Class | Size / Line height |
372
- |---|---|
373
- | `body-lg` | 18px / 28px |
374
- | `body-md` | 16px / 24px |
375
- | `body-sm` | 12px / 16px |
376
- | `body-xs` | 8px / 12px |
585
+ > Body text bold weight is 700. Body regular is 400. Apply via standard `font-bold` / `font-medium` / `font-semibold` Tailwind utilities (medium = 500, semibold = 600).
377
586
 
378
587
  ### Font utilities
379
588
 
380
- | Tailwind class | Font |
589
+ | Tailwind class | Font family |
381
590
  |---|---|
382
- | `font-display` | Plus Jakarta Sans — headings, display text |
383
- | `font-body` or `font-sans` | Plus Jakarta Sans — body text |
591
+ | `font-display` | Inter — headings, display text |
592
+ | `font-body` or `font-sans` | Inter — body text |
593
+ | `font-mono` | Red Hat Mono — code, tabular figures |
384
594
 
385
595
  ---
386
596
 
@@ -393,7 +603,7 @@ When you bump `@deriv-ds/design-intelligence-layer` and run `npm install` (or `n
393
603
  | You **import** components only from `@deriv-ds/design-intelligence-layer` | After install and a rebuild, your app uses the **new** implementations in `node_modules/.../dist` — buttons, cards, etc. reflect the version you installed. |
394
604
  | You **copied** `components/ui/*` (or similar) into your repo | Those files **do not** auto-update. You must delete them and switch to package imports, or manually merge changes from the new package. |
395
605
 
396
- **Overrides:** Passing large `className` strings onto DS components can mask new defaults (e.g. old radius after a pill button update). After upgrading, review those callsites.
606
+ **Overrides:** Passing large `className` strings onto Quill components can mask new defaults (e.g. old radius after a "pill button" update). After upgrading, review those callsites.
397
607
 
398
608
  **Cursor / AI agents:** The package ships agent rules at `node_modules/@deriv-ds/design-intelligence-layer/guides/rules/design-system-consuming-project.mdc`. Cursor does **not** load rules from `node_modules` by default — **re-copy** that file into `.cursor/rules/` after each upgrade so instructions match the release (same command as in **AI Agent Setup** below). The rules include **Rule 7 — Package version upgrades**: agents should search for duplicated components, align with the package, and **tell you explicitly** if local component code was replaced.
399
609
 
@@ -416,22 +626,22 @@ This tells any AI agent to:
416
626
 
417
627
  **Design principles file** (bundled in the package):
418
628
  ```
419
- node_modules/@deriv-ds/design-intelligence-layer/guides/design-principles/trading-game-design-principles.md
629
+ node_modules/@deriv-ds/design-intelligence-layer/guides/design-principles/quill-design-principles.md
420
630
  ```
421
631
 
422
632
  **Accessibility standards file** (bundled in the package):
423
633
  ```
424
- node_modules/@deriv-ds/design-intelligence-layer/guides/accessibility-standards/trading-game-accessibility-standards.md
634
+ node_modules/@deriv-ds/design-intelligence-layer/guides/accessibility-standards/quill-accessibility-standards.md
425
635
  ```
426
636
 
427
637
  **Personas file** (bundled in the package):
428
638
  ```
429
- node_modules/@deriv-ds/design-intelligence-layer/guides/personas/trading-game-player-field-guide.md
639
+ node_modules/@deriv-ds/design-intelligence-layer/guides/personas/deriv-user-field-guide.md
430
640
  ```
431
641
 
432
642
  **Brand voice** (bundled in the package):
433
643
  ```
434
- node_modules/@deriv-ds/design-intelligence-layer/guides/brand-voice/trading-game-brand-voice.md
644
+ node_modules/@deriv-ds/design-intelligence-layer/guides/brand-voice/quill-brand-voice.md
435
645
  ```
436
646
 
437
647
  All four files apply to all projects built with this package — landing pages, product screens, and games. Every AI agent must read all of them before starting any build. Run the design principles and accessibility checklists before completing any screen. Use the personas and brand voice to guide all player-facing copy.
@@ -454,11 +664,11 @@ Add the following to your project's `CLAUDE.md`:
454
664
  ```markdown
455
665
  ## Design System
456
666
 
457
- This project uses @deriv-ds/design-intelligence-layer. Before writing any UI:
458
- 1. Read node_modules/@deriv-ds/design-intelligence-layer/guides/design-principles/trading-game-design-principles.md — apply the 8 principles and run the 7-point checklist on every screen
459
- 2. Read node_modules/@deriv-ds/design-intelligence-layer/guides/accessibility-standards/trading-game-accessibility-standards.md — apply WCAG 2.1 AA standards and run the 9-point accessibility checklist on every screen
460
- 3. Read node_modules/@deriv-ds/design-intelligence-layer/guides/personas/trading-game-player-field-guide.md — understand the 3 player modes (Edge Seeker, System Runner, Public Predictor) that shape all copy and UX
461
- 4. Read node_modules/@deriv-ds/design-intelligence-layer/guides/brand-voice/trading-game-brand-voice.md — apply the brand voice: channel-specific voice, banned phrases, vocabulary, and formatting rules for all player-facing copy
667
+ This project uses @deriv-ds/design-intelligence-layer (Quill Design System). Before writing any UI:
668
+ 1. Read node_modules/@deriv-ds/design-intelligence-layer/guides/design-principles/quill-design-principles.md — apply the 8 principles and run the 7-point checklist on every screen
669
+ 2. Read node_modules/@deriv-ds/design-intelligence-layer/guides/accessibility-standards/quill-accessibility-standards.md — apply WCAG 2.1 AA standards and run the 9-point accessibility checklist on every screen
670
+ 3. Read node_modules/@deriv-ds/design-intelligence-layer/guides/personas/deriv-user-field-guide.md — understand the player personas that shape all copy and UX
671
+ 4. Read node_modules/@deriv-ds/design-intelligence-layer/guides/brand-voice/quill-brand-voice.md — apply the brand voice: channel-specific voice, banned phrases, vocabulary, and formatting rules for all player-facing copy
462
672
  5. Check if the component exists in the package — import it, don't re-implement
463
673
  6. Use only design token classes (bg-prominent, text-on-prominent, border-border-subtle, etc.) — no hardcoded hex or raw Tailwind palette colors
464
674
  7. Do not install lucide-react, tailwindcss, or other bundled dependencies separately
@@ -475,15 +685,18 @@ See node_modules/@deriv-ds/design-intelligence-layer/README.md for complete toke
475
685
 
476
686
  | Wrong | Right | Why |
477
687
  |---|---|---|
478
- | `bg-gray-100` | `bg-subtle` | Raw Tailwind palette — use tokens |
479
- | `bg-white` | `bg-prominent` or `bg-card` | Not a semantic token |
480
- | `text-white` | `text-on-prominent-static-inverse` | Use the semantic inverse token |
481
- | `text-black` | `text-on-prominent` | Not a semantic token |
688
+ | `bg-gray-100` | `bg-secondary-surface` | Raw Tailwind palette — use tokens |
689
+ | `bg-white` | `bg-primary-surface` | Not a semantic token; breaks dark mode |
690
+ | `bg-[#181C25]` | `bg-primary-canvas` (dark) | Hardcoded hex — use the canvas token |
691
+ | `text-white` | `text-prominent-static-dark` | Use `static-dark` for "always white" cases |
692
+ | `text-black` | `text-prominent` | Not a semantic token; breaks dark mode |
482
693
  | `bg-black/50` | `bg-overlay` | Overlay has its own token |
483
- | `bg-[#2323FF]` | `bg-primary` | Hardcoded hex use token |
484
- | `border-border` | `border-border-subtle` | Old nameprefer the new explicit name |
694
+ | `bg-[#2323FF]` or `bg-blue-600` | `bg-primary` | Brand is **coral `#FF444F`**, not blue |
695
+ | `bg-[#FF444F]` | `bg-primary` | Hardcoded hexuse token |
696
+ | `border-border` | `border-subtle-default` | Old name — prefer the new explicit name |
485
697
  | `bg-[var(--primary)]` | `bg-primary` | Raw CSS var — Tailwind v4 maps tokens directly |
486
698
  | `hsl(var(--primary))` | `bg-primary` | Tailwind v3 syntax — not needed in v4 |
699
+ | `font-[Plus_Jakarta_Sans]` | `font-sans` (Inter) | Project font is Inter, not Plus Jakarta Sans |
487
700
  | Installing `lucide-react` | Already bundled | Icons are included in the package |
488
701
 
489
702
  ---
@@ -509,8 +722,8 @@ These are bundled with the package. Installing them separately can cause version
509
722
 
510
723
  ```bash
511
724
  # Clone
512
- git clone https://github.com/trading-game/TG-design-system.git
513
- cd TG-design-system
725
+ git clone https://github.com/deriv-com/deriv-intelligence-layer.git
726
+ cd deriv-intelligence-layer
514
727
 
515
728
  # Install dependencies
516
729
  npm install
@@ -541,4 +754,4 @@ Design tokens are managed in Figma and exported as CSS variables. To update:
541
754
  - **Tailwind CSS v4** — CSS-first configuration
542
755
  - **shadcn/ui** (New York style) — base component primitives
543
756
  - **Radix UI** — accessible headless primitives
544
- - **Figma** — source of truth for design tokens
757
+ - **Figma** — source of truth for design tokens