@lo-ink/ui 0.1.1 → 0.2.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.
@@ -1,9 +1,10 @@
1
1
  import type { HTMLAttributes, ReactNode } from "react";
2
2
  export interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
3
3
  title: ReactNode;
4
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
4
5
  description?: ReactNode;
5
6
  icon?: ReactNode;
6
7
  action?: ReactNode;
7
8
  }
8
- export declare function EmptyState({ title, description, icon, action, className, ...props }: EmptyStateProps): import("react").JSX.Element;
9
+ export declare function EmptyState({ title, headingLevel, description, icon, action, className, ...props }: EmptyStateProps): import("react").JSX.Element;
9
10
  //# sourceMappingURL=EmptyState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../src/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,cAAc,CAAC,cAAc,CAAC,EAC9B,OAAO,CACR;IACC,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,+BAejB"}
1
+ {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../src/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,cAAc,CAAC,cAAc,CAAC,EAC9B,OAAO,CACR;IACC,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,YAAgB,EAChB,WAAW,EACX,IAAI,EACJ,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,+BAgBjB"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { classes } from "./utils.js";
3
- export function EmptyState({ title, description, icon, action, className, ...props }) {
4
- return (_jsxs("div", { ...props, className: classes("lo-ui-empty-state", className), children: [icon && (_jsx("div", { className: "lo-ui-empty-state__icon", "aria-hidden": "true", children: icon })), _jsx("h2", { className: "lo-ui-empty-state__title", children: title }), description && (_jsx("p", { className: "lo-ui-empty-state__description", children: description })), action && _jsx("div", { className: "lo-ui-empty-state__action", children: action })] }));
3
+ export function EmptyState({ title, headingLevel = 2, description, icon, action, className, ...props }) {
4
+ const Tag = `h${headingLevel}`;
5
+ return (_jsxs("div", { ...props, className: classes("lo-ui-empty-state", className), children: [icon && (_jsx("div", { className: "lo-ui-empty-state__icon", "aria-hidden": "true", children: icon })), _jsx(Tag, { className: "lo-ui-empty-state__title", children: title }), description && (_jsx("p", { className: "lo-ui-empty-state__description", children: description })), action && _jsx("div", { className: "lo-ui-empty-state__action", children: action })] }));
5
6
  }
package/dist/List.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { type HTMLAttributes, type ReactNode } from "react";
2
2
  export interface ListProps extends HTMLAttributes<HTMLUListElement> {
3
3
  label?: ReactNode;
4
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
4
5
  }
5
- export declare function List({ label, children, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ListProps): import("react").JSX.Element;
6
+ export declare function List({ label, headingLevel, children, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ListProps): import("react").JSX.Element;
6
7
  export interface CellProps extends Omit<HTMLAttributes<HTMLLIElement>, "title"> {
7
8
  title: ReactNode;
8
9
  subtitle?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../src/List.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/E,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACjE,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,GAAG,KAAK,EACT,EAAE,SAAS,+BAsBX;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CACrC,cAAc,CAAC,aAAa,CAAC,EAC7B,OAAO,CACR;IACC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,wEAAwE;IACxE,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,IAAI,qGA6Df,CAAC"}
1
+ {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../src/List.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/E,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACjE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAClC;AAED,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,YAAgB,EAChB,QAAQ,EACR,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,GAAG,KAAK,EACT,EAAE,SAAS,+BAuBX;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CACrC,cAAc,CAAC,aAAa,CAAC,EAC7B,OAAO,CACR;IACC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,wEAAwE;IACxE,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,IAAI,qGA6Df,CAAC"}
package/dist/List.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { forwardRef, useId } from "react";
3
3
  import { classes } from "./utils.js";
4
- export function List({ label, children, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }) {
4
+ export function List({ label, headingLevel = 2, children, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }) {
5
+ const Tag = `h${headingLevel}`;
5
6
  const generatedId = useId();
6
7
  const labelId = label ? `${generatedId}-label` : undefined;
7
8
  const effectiveLabelledBy = ariaLabelledBy ?? (ariaLabel === undefined ? labelId : undefined);
8
- return (_jsxs("section", { className: "lo-ui-list-section", children: [label && (_jsx("h2", { className: "lo-ui-list-label", id: labelId, children: label })), _jsx("ul", { ...props, "aria-label": ariaLabel, "aria-labelledby": effectiveLabelledBy, className: classes("lo-ui-list", className), children: children })] }));
9
+ return (_jsxs("section", { className: "lo-ui-list-section", children: [label && (_jsx(Tag, { className: "lo-ui-list-label", id: labelId, children: label })), _jsx("ul", { ...props, "aria-label": ariaLabel, "aria-labelledby": effectiveLabelledBy, className: classes("lo-ui-list", className), children: children })] }));
9
10
  }
10
11
  export const Cell = forwardRef(function Cell({ title, subtitle, leading, trailing, trailingAction, onPress, disabled = false, className, ...props }, ref) {
11
12
  const content = (_jsxs(_Fragment, { children: [leading && _jsx("span", { className: "lo-ui-cell__leading", children: leading }), _jsxs("span", { className: "lo-ui-cell__body", children: [_jsx("span", { className: "lo-ui-cell__title", children: title }), subtitle && _jsx("span", { className: "lo-ui-cell__subtitle", children: subtitle })] }), trailing && _jsx("span", { className: "lo-ui-cell__trailing", children: trailing }), onPress && !trailing && !trailingAction && (_jsx("svg", { className: "lo-ui-cell__chevron", viewBox: "0 0 20 20", "aria-hidden": "true", children: _jsx("path", { d: "m7.5 4 6 6-6 6" }) }))] }));
@@ -4,5 +4,8 @@ export interface TextProps extends HTMLAttributes<HTMLParagraphElement> {
4
4
  size?: "caption" | "label" | "body";
5
5
  }
6
6
  export declare function Text({ tone, size, className, ...props }: TextProps): import("react").JSX.Element;
7
- export declare function Heading({ className, ...props }: HTMLAttributes<HTMLHeadingElement>): import("react").JSX.Element;
7
+ export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
8
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
9
+ }
10
+ export declare function Heading({ level, className, ...props }: HeadingProps): import("react").JSX.Element;
8
11
  //# sourceMappingURL=Typography.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../src/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IACrE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC1C,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;CACrC;AAED,wBAAgB,IAAI,CAAC,EACnB,IAAgB,EAChB,IAAa,EACb,SAAS,EACT,GAAG,KAAK,EACT,EAAE,SAAS,+BAYX;AAED,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,kBAAkB,CAAC,+BAEpC"}
1
+ {"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../src/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IACrE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC1C,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;CACrC;AAED,wBAAgB,IAAI,CAAC,EACnB,IAAgB,EAChB,IAAa,EACb,SAAS,EACT,GAAG,KAAK,EACT,EAAE,SAAS,+BAYX;AAED,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,kBAAkB,CAAC;IACtE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC/B;AAED,wBAAgB,OAAO,CAAC,EAAE,KAAS,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,+BAGvE"}
@@ -3,6 +3,7 @@ import { classes } from "./utils.js";
3
3
  export function Text({ tone = "primary", size = "body", className, ...props }) {
4
4
  return (_jsx("p", { ...props, className: classes("lo-ui-text", `lo-ui-text--${tone}`, `lo-ui-text--${size}`, className) }));
5
5
  }
6
- export function Heading({ className, ...props }) {
7
- return _jsx("h1", { ...props, className: classes("lo-ui-heading", className) });
6
+ export function Heading({ level = 1, className, ...props }) {
7
+ const Tag = `h${level}`;
8
+ return _jsx(Tag, { ...props, className: classes("lo-ui-heading", className) });
8
9
  }
package/dist/index.d.ts CHANGED
@@ -5,5 +5,5 @@ export { Inline, Stack } from "./Layout.js";
5
5
  export { Cell, List, type CellProps, type ListProps } from "./List.js";
6
6
  export { Checkbox, Switch, type SelectionControlProps, } from "./SelectionControl.js";
7
7
  export { TextField, type TextFieldProps } from "./TextField.js";
8
- export { Heading, Text, type TextProps } from "./Typography.js";
8
+ export { Heading, Text, type HeadingProps, type TextProps, } from "./Typography.js";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,OAAO,EACP,IAAI,EACJ,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -5,4 +5,4 @@ export { Inline, Stack } from "./Layout.js";
5
5
  export { Cell, List } from "./List.js";
6
6
  export { Checkbox, Switch, } from "./SelectionControl.js";
7
7
  export { TextField } from "./TextField.js";
8
- export { Heading, Text } from "./Typography.js";
8
+ export { Heading, Text, } from "./Typography.js";
package/dist/styles.css CHANGED
@@ -27,7 +27,12 @@
27
27
  min-height: var(--lo-size-control);
28
28
  padding: 0 var(--lo-space-5);
29
29
  border: 1px solid transparent;
30
- border-radius: var(--lo-radius-md);
30
+ border-radius: var(--lo-radius-full);
31
+ min-width: 0;
32
+ max-width: 100%;
33
+ white-space: normal;
34
+ overflow-wrap: anywhere;
35
+ text-align: center;
31
36
  display: inline-flex;
32
37
  align-items: center;
33
38
  justify-content: center;
@@ -62,7 +67,7 @@
62
67
 
63
68
  .lo-ui-button--primary {
64
69
  color: var(--lo-color-accent-contrast);
65
- background: var(--lo-color-accent);
70
+ background: var(--lo-color-accent-fill);
66
71
  }
67
72
 
68
73
  .lo-ui-button--primary:hover:not(:disabled) {
@@ -70,12 +75,19 @@
70
75
  }
71
76
 
72
77
  .lo-ui-button--secondary {
73
- color: var(--lo-color-text);
74
- background: var(--lo-color-surface);
75
- border-color: var(--lo-color-border);
78
+ color: var(--lo-color-accent-text);
79
+ background: var(--lo-color-accent-soft);
80
+ border-color: transparent;
81
+ }
82
+
83
+ .lo-ui-button--secondary:hover:not(:disabled) {
84
+ background: color-mix(
85
+ in srgb,
86
+ var(--lo-color-accent) 20%,
87
+ var(--lo-color-surface)
88
+ );
76
89
  }
77
90
 
78
- .lo-ui-button--secondary:hover:not(:disabled),
79
91
  .lo-ui-button--quiet:hover:not(:disabled) {
80
92
  background: var(--lo-color-accent-soft);
81
93
  }
@@ -91,7 +103,7 @@
91
103
  }
92
104
 
93
105
  .lo-ui-button--quiet {
94
- color: var(--lo-color-accent);
106
+ color: var(--lo-color-accent-text);
95
107
  background: transparent;
96
108
  }
97
109
 
@@ -135,7 +147,7 @@
135
147
  padding: 10px var(--lo-space-3);
136
148
  color: var(--lo-color-text);
137
149
  background: var(--lo-color-surface);
138
- border: 1px solid var(--lo-color-border);
150
+ border: 1px solid var(--lo-color-control-border);
139
151
  border-radius: var(--lo-radius-md);
140
152
  font-size: 16px;
141
153
  transition:
@@ -228,7 +240,7 @@
228
240
  padding: 2px;
229
241
  border: 0;
230
242
  border-radius: var(--lo-radius-full);
231
- background: var(--lo-color-border);
243
+ background: var(--lo-color-control-border);
232
244
  cursor: pointer;
233
245
  transition: background-color var(--lo-motion-fast) var(--lo-ease-out);
234
246
  }
@@ -245,7 +257,7 @@
245
257
  }
246
258
 
247
259
  .lo-ui-switch:checked {
248
- background: var(--lo-color-accent);
260
+ background: var(--lo-color-accent-fill);
249
261
  }
250
262
 
251
263
  .lo-ui-switch:checked::after {
@@ -265,7 +277,7 @@
265
277
  margin: 0;
266
278
  display: grid;
267
279
  place-items: center;
268
- border: 1.5px solid var(--lo-color-border);
280
+ border: 1.5px solid var(--lo-color-control-border);
269
281
  border-radius: 7px;
270
282
  background: var(--lo-color-surface);
271
283
  cursor: pointer;
@@ -282,8 +294,13 @@
282
294
  }
283
295
 
284
296
  .lo-ui-checkbox:checked {
285
- background: var(--lo-color-accent);
286
- border-color: var(--lo-color-accent);
297
+ background: var(--lo-color-accent-fill);
298
+ border-color: var(--lo-color-accent-fill);
299
+ }
300
+
301
+ .lo-ui-checkbox:disabled {
302
+ cursor: default;
303
+ opacity: 0.5;
287
304
  }
288
305
 
289
306
  .lo-ui-checkbox:checked::after {
@@ -384,6 +401,7 @@
384
401
 
385
402
  .lo-ui-cell__title {
386
403
  font-size: var(--lo-font-size-body);
404
+ font-weight: var(--lo-font-weight-medium);
387
405
  }
388
406
 
389
407
  .lo-ui-cell__subtitle {
@@ -424,7 +442,7 @@
424
442
  place-items: center;
425
443
  border-radius: 11px;
426
444
  color: var(--lo-color-accent-contrast);
427
- background: var(--lo-color-accent);
445
+ background: var(--lo-color-accent-fill);
428
446
  }
429
447
 
430
448
  .lo-ui-app-icon--small {
@@ -489,6 +507,7 @@
489
507
  }
490
508
 
491
509
  .lo-ui-empty-state__title {
510
+ color: var(--lo-color-text);
492
511
  font-size: var(--lo-font-size-body);
493
512
  line-height: var(--lo-line-height-tight);
494
513
  }
@@ -519,11 +538,14 @@
519
538
  }
520
539
 
521
540
  .lo-ui-heading {
541
+ color: var(--lo-color-text);
542
+ font-weight: var(--lo-font-weight-bold);
522
543
  font-size: var(--lo-font-size-title);
523
544
  line-height: var(--lo-line-height-tight);
524
545
  }
525
546
 
526
547
  .lo-ui-text {
548
+ color: var(--lo-color-text);
527
549
  line-height: var(--lo-line-height-body);
528
550
  }
529
551
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lo-ink/ui",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Accessible React components for LO miniapps",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "build": "tsc -p tsconfig.json && node scripts/copy-assets.mjs"
34
34
  },
35
35
  "dependencies": {
36
- "@lo-ink/design-tokens": "0.1.1"
36
+ "@lo-ink/design-tokens": "0.2.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": ">=18 <20",
@@ -6,6 +6,7 @@ export interface EmptyStateProps extends Omit<
6
6
  "title"
7
7
  > {
8
8
  title: ReactNode;
9
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
9
10
  description?: ReactNode;
10
11
  icon?: ReactNode;
11
12
  action?: ReactNode;
@@ -13,12 +14,14 @@ export interface EmptyStateProps extends Omit<
13
14
 
14
15
  export function EmptyState({
15
16
  title,
17
+ headingLevel = 2,
16
18
  description,
17
19
  icon,
18
20
  action,
19
21
  className,
20
22
  ...props
21
23
  }: EmptyStateProps) {
24
+ const Tag = `h${headingLevel}` as "h2" | "h3" | "h4" | "h5" | "h6";
22
25
  return (
23
26
  <div {...props} className={classes("lo-ui-empty-state", className)}>
24
27
  {icon && (
@@ -26,7 +29,7 @@ export function EmptyState({
26
29
  {icon}
27
30
  </div>
28
31
  )}
29
- <h2 className="lo-ui-empty-state__title">{title}</h2>
32
+ <Tag className="lo-ui-empty-state__title">{title}</Tag>
30
33
  {description && (
31
34
  <p className="lo-ui-empty-state__description">{description}</p>
32
35
  )}
package/src/List.tsx CHANGED
@@ -3,16 +3,19 @@ import { classes } from "./utils.js";
3
3
 
4
4
  export interface ListProps extends HTMLAttributes<HTMLUListElement> {
5
5
  label?: ReactNode;
6
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
6
7
  }
7
8
 
8
9
  export function List({
9
10
  label,
11
+ headingLevel = 2,
10
12
  children,
11
13
  className,
12
14
  "aria-label": ariaLabel,
13
15
  "aria-labelledby": ariaLabelledBy,
14
16
  ...props
15
17
  }: ListProps) {
18
+ const Tag = `h${headingLevel}` as "h2" | "h3" | "h4" | "h5" | "h6";
16
19
  const generatedId = useId();
17
20
  const labelId = label ? `${generatedId}-label` : undefined;
18
21
  const effectiveLabelledBy =
@@ -20,9 +23,9 @@ export function List({
20
23
  return (
21
24
  <section className="lo-ui-list-section">
22
25
  {label && (
23
- <h2 className="lo-ui-list-label" id={labelId}>
26
+ <Tag className="lo-ui-list-label" id={labelId}>
24
27
  {label}
25
- </h2>
28
+ </Tag>
26
29
  )}
27
30
  <ul
28
31
  {...props}
@@ -25,9 +25,11 @@ export function Text({
25
25
  );
26
26
  }
27
27
 
28
- export function Heading({
29
- className,
30
- ...props
31
- }: HTMLAttributes<HTMLHeadingElement>) {
32
- return <h1 {...props} className={classes("lo-ui-heading", className)} />;
28
+ export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
29
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
30
+ }
31
+
32
+ export function Heading({ level = 1, className, ...props }: HeadingProps) {
33
+ const Tag = `h${level}` as "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
34
+ return <Tag {...props} className={classes("lo-ui-heading", className)} />;
33
35
  }
package/src/index.ts CHANGED
@@ -9,4 +9,9 @@ export {
9
9
  type SelectionControlProps,
10
10
  } from "./SelectionControl.js";
11
11
  export { TextField, type TextFieldProps } from "./TextField.js";
12
- export { Heading, Text, type TextProps } from "./Typography.js";
12
+ export {
13
+ Heading,
14
+ Text,
15
+ type HeadingProps,
16
+ type TextProps,
17
+ } from "./Typography.js";
package/src/styles.css CHANGED
@@ -27,7 +27,12 @@
27
27
  min-height: var(--lo-size-control);
28
28
  padding: 0 var(--lo-space-5);
29
29
  border: 1px solid transparent;
30
- border-radius: var(--lo-radius-md);
30
+ border-radius: var(--lo-radius-full);
31
+ min-width: 0;
32
+ max-width: 100%;
33
+ white-space: normal;
34
+ overflow-wrap: anywhere;
35
+ text-align: center;
31
36
  display: inline-flex;
32
37
  align-items: center;
33
38
  justify-content: center;
@@ -62,7 +67,7 @@
62
67
 
63
68
  .lo-ui-button--primary {
64
69
  color: var(--lo-color-accent-contrast);
65
- background: var(--lo-color-accent);
70
+ background: var(--lo-color-accent-fill);
66
71
  }
67
72
 
68
73
  .lo-ui-button--primary:hover:not(:disabled) {
@@ -70,12 +75,19 @@
70
75
  }
71
76
 
72
77
  .lo-ui-button--secondary {
73
- color: var(--lo-color-text);
74
- background: var(--lo-color-surface);
75
- border-color: var(--lo-color-border);
78
+ color: var(--lo-color-accent-text);
79
+ background: var(--lo-color-accent-soft);
80
+ border-color: transparent;
81
+ }
82
+
83
+ .lo-ui-button--secondary:hover:not(:disabled) {
84
+ background: color-mix(
85
+ in srgb,
86
+ var(--lo-color-accent) 20%,
87
+ var(--lo-color-surface)
88
+ );
76
89
  }
77
90
 
78
- .lo-ui-button--secondary:hover:not(:disabled),
79
91
  .lo-ui-button--quiet:hover:not(:disabled) {
80
92
  background: var(--lo-color-accent-soft);
81
93
  }
@@ -91,7 +103,7 @@
91
103
  }
92
104
 
93
105
  .lo-ui-button--quiet {
94
- color: var(--lo-color-accent);
106
+ color: var(--lo-color-accent-text);
95
107
  background: transparent;
96
108
  }
97
109
 
@@ -135,7 +147,7 @@
135
147
  padding: 10px var(--lo-space-3);
136
148
  color: var(--lo-color-text);
137
149
  background: var(--lo-color-surface);
138
- border: 1px solid var(--lo-color-border);
150
+ border: 1px solid var(--lo-color-control-border);
139
151
  border-radius: var(--lo-radius-md);
140
152
  font-size: 16px;
141
153
  transition:
@@ -228,7 +240,7 @@
228
240
  padding: 2px;
229
241
  border: 0;
230
242
  border-radius: var(--lo-radius-full);
231
- background: var(--lo-color-border);
243
+ background: var(--lo-color-control-border);
232
244
  cursor: pointer;
233
245
  transition: background-color var(--lo-motion-fast) var(--lo-ease-out);
234
246
  }
@@ -245,7 +257,7 @@
245
257
  }
246
258
 
247
259
  .lo-ui-switch:checked {
248
- background: var(--lo-color-accent);
260
+ background: var(--lo-color-accent-fill);
249
261
  }
250
262
 
251
263
  .lo-ui-switch:checked::after {
@@ -265,7 +277,7 @@
265
277
  margin: 0;
266
278
  display: grid;
267
279
  place-items: center;
268
- border: 1.5px solid var(--lo-color-border);
280
+ border: 1.5px solid var(--lo-color-control-border);
269
281
  border-radius: 7px;
270
282
  background: var(--lo-color-surface);
271
283
  cursor: pointer;
@@ -282,8 +294,13 @@
282
294
  }
283
295
 
284
296
  .lo-ui-checkbox:checked {
285
- background: var(--lo-color-accent);
286
- border-color: var(--lo-color-accent);
297
+ background: var(--lo-color-accent-fill);
298
+ border-color: var(--lo-color-accent-fill);
299
+ }
300
+
301
+ .lo-ui-checkbox:disabled {
302
+ cursor: default;
303
+ opacity: 0.5;
287
304
  }
288
305
 
289
306
  .lo-ui-checkbox:checked::after {
@@ -384,6 +401,7 @@
384
401
 
385
402
  .lo-ui-cell__title {
386
403
  font-size: var(--lo-font-size-body);
404
+ font-weight: var(--lo-font-weight-medium);
387
405
  }
388
406
 
389
407
  .lo-ui-cell__subtitle {
@@ -424,7 +442,7 @@
424
442
  place-items: center;
425
443
  border-radius: 11px;
426
444
  color: var(--lo-color-accent-contrast);
427
- background: var(--lo-color-accent);
445
+ background: var(--lo-color-accent-fill);
428
446
  }
429
447
 
430
448
  .lo-ui-app-icon--small {
@@ -489,6 +507,7 @@
489
507
  }
490
508
 
491
509
  .lo-ui-empty-state__title {
510
+ color: var(--lo-color-text);
492
511
  font-size: var(--lo-font-size-body);
493
512
  line-height: var(--lo-line-height-tight);
494
513
  }
@@ -519,11 +538,14 @@
519
538
  }
520
539
 
521
540
  .lo-ui-heading {
541
+ color: var(--lo-color-text);
542
+ font-weight: var(--lo-font-weight-bold);
522
543
  font-size: var(--lo-font-size-title);
523
544
  line-height: var(--lo-line-height-tight);
524
545
  }
525
546
 
526
547
  .lo-ui-text {
548
+ color: var(--lo-color-text);
527
549
  line-height: var(--lo-line-height-body);
528
550
  }
529
551