ionbase-ui 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.
Files changed (85) hide show
  1. package/dist/components/Avatar.d.ts +8 -5
  2. package/dist/components/Avatar.d.ts.map +1 -1
  3. package/dist/components/Avatar.js +31 -11
  4. package/dist/components/Avatar.js.map +1 -1
  5. package/dist/components/Button.d.ts +4 -0
  6. package/dist/components/Button.d.ts.map +1 -1
  7. package/dist/components/Button.js +6 -2
  8. package/dist/components/Button.js.map +1 -1
  9. package/dist/components/Checkbox.d.ts +6 -0
  10. package/dist/components/Checkbox.d.ts.map +1 -1
  11. package/dist/components/Checkbox.js +6 -3
  12. package/dist/components/Checkbox.js.map +1 -1
  13. package/dist/components/Input.d.ts +30 -2
  14. package/dist/components/Input.d.ts.map +1 -1
  15. package/dist/components/Input.js +23 -7
  16. package/dist/components/Input.js.map +1 -1
  17. package/dist/components/Menu.d.ts +6 -0
  18. package/dist/components/Menu.d.ts.map +1 -1
  19. package/dist/components/Menu.js +11 -7
  20. package/dist/components/Menu.js.map +1 -1
  21. package/dist/components/NavItem.d.ts +4 -0
  22. package/dist/components/NavItem.d.ts.map +1 -1
  23. package/dist/components/NavItem.js +22 -2
  24. package/dist/components/NavItem.js.map +1 -1
  25. package/dist/components/Radio.d.ts +11 -0
  26. package/dist/components/Radio.d.ts.map +1 -1
  27. package/dist/components/Radio.js +25 -17
  28. package/dist/components/Radio.js.map +1 -1
  29. package/dist/components/ScrollProgress.d.ts.map +1 -1
  30. package/dist/components/ScrollProgress.js +1 -0
  31. package/dist/components/ScrollProgress.js.map +1 -1
  32. package/dist/components/Select.d.ts +11 -2
  33. package/dist/components/Select.d.ts.map +1 -1
  34. package/dist/components/Select.js +6 -3
  35. package/dist/components/Select.js.map +1 -1
  36. package/dist/components/Table.d.ts +26 -1
  37. package/dist/components/Table.d.ts.map +1 -1
  38. package/dist/components/Table.js +30 -7
  39. package/dist/components/Table.js.map +1 -1
  40. package/dist/components/Tabs.d.ts +7 -3
  41. package/dist/components/Tabs.d.ts.map +1 -1
  42. package/dist/components/Tabs.js +13 -2
  43. package/dist/components/Tabs.js.map +1 -1
  44. package/dist/components/Toggle.d.ts +6 -0
  45. package/dist/components/Toggle.d.ts.map +1 -1
  46. package/dist/components/Toggle.js +6 -3
  47. package/dist/components/Toggle.js.map +1 -1
  48. package/dist/components/dom-props.d.ts +59 -0
  49. package/dist/components/dom-props.d.ts.map +1 -1
  50. package/dist/components/dom-props.js +86 -0
  51. package/dist/components/dom-props.js.map +1 -1
  52. package/dist/components/index.d.ts +1 -1
  53. package/dist/components/index.d.ts.map +1 -1
  54. package/dist/components/index.js.map +1 -1
  55. package/dist/components/resolve-disabled.d.ts +9 -0
  56. package/dist/components/resolve-disabled.d.ts.map +1 -0
  57. package/dist/components/resolve-disabled.js +15 -0
  58. package/dist/components/resolve-disabled.js.map +1 -0
  59. package/dist/index.d.ts +5 -6
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +5 -6
  62. package/dist/index.js.map +1 -1
  63. package/dist/styles/button.css +36 -7
  64. package/dist/styles/checkbox.css +2 -2
  65. package/dist/styles/index.css +133 -0
  66. package/dist/styles/input.css +2 -2
  67. package/dist/styles/menu.css +1 -1
  68. package/dist/styles/nav-item.css +2 -2
  69. package/dist/styles/radio.css +2 -2
  70. package/dist/styles/scroll-progress.css +11 -9
  71. package/dist/styles/select.css +2 -2
  72. package/dist/styles/table.css +11 -7
  73. package/dist/styles/tabs.css +15 -6
  74. package/dist/styles/toggle.css +10 -3
  75. package/dist/styles/tokens/base.css +1 -1
  76. package/dist/styles/tokens/elevation.css +8 -8
  77. package/dist/styles/tokens/index.css +1 -0
  78. package/dist/styles/tokens/motion.css +51 -0
  79. package/dist/tokens/index.d.ts +1 -1
  80. package/dist/tokens/index.js +1 -1
  81. package/dist/tokens-js.d.ts +12 -0
  82. package/dist/tokens-js.d.ts.map +1 -0
  83. package/dist/tokens-js.js +12 -0
  84. package/dist/tokens-js.js.map +1 -0
  85. package/package.json +7 -3
@@ -9,9 +9,13 @@
9
9
  * variables rather than restating five declarations, and the icon rule needs no
10
10
  * per-size override.
11
11
  *
12
- * Only the horizontal orientation is implemented. Figma also defines vertical;
13
- * the track modifier is named `--horizontal` so vertical is additive rather
14
- * than a rename.
12
+ * Vertical is STRUCTURAL ONLY. `--vertical` stacks the track and stretches the
13
+ * items, which is what the word means and needs no design input. Its
14
+ * decoration does: the underline rule is a `border-bottom` and the pill track's
15
+ * padding is written for the horizontal axis, and which edge the underline
16
+ * moves to is Figma's call, not this file's. Until that is specified, a
17
+ * vertical track is correctly stacked, correctly navigable and correctly
18
+ * announced, but wears the horizontal type styling.
15
19
  */
16
20
 
17
21
  /* Track */
@@ -23,6 +27,11 @@
23
27
  padding: 0;
24
28
  }
25
29
 
30
+ .ion-tabs__track--vertical {
31
+ flex-direction: column;
32
+ align-items: stretch;
33
+ }
34
+
26
35
  .ion-tabs__track--underline.ion-tabs__track--horizontal {
27
36
  display: inline-flex;
28
37
  gap: var(--spacing-4);
@@ -71,9 +80,9 @@
71
80
  cursor: pointer;
72
81
  user-select: none;
73
82
  transition:
74
- color 150ms cubic-bezier(0.4, 0, 0.2, 1),
75
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
76
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
83
+ color var(--ion-duration-base) var(--ion-ease-out),
84
+ background-color var(--ion-duration-base) var(--ion-ease-out),
85
+ border-color var(--ion-duration-base) var(--ion-ease-out);
77
86
  }
78
87
 
79
88
  .ion-tabs__item--sm {
@@ -115,8 +115,8 @@
115
115
  (var(--ion-toggle-line-height) - var(--ion-toggle-track-h)) / 2
116
116
  );
117
117
  transition:
118
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
119
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
118
+ background-color var(--ion-duration-base) var(--ion-ease-out),
119
+ border-color var(--ion-duration-base) var(--ion-ease-out);
120
120
  }
121
121
 
122
122
  .ion-toggle__thumb {
@@ -127,7 +127,14 @@
127
127
 
128
128
  /* Cast, not bevelled — and the same in both states, so it is unconditional. */
129
129
  box-shadow: var(--ion-shadow-shadow-xs);
130
- transition: margin 150ms cubic-bezier(0.4, 0, 0.2, 1);
130
+
131
+ /*
132
+ * `ease-in-out`, not the `ease-out` every colour change uses. The knob is the
133
+ * one thing in the system that travels the same path in both directions, so
134
+ * a symmetric curve is what makes on and off feel like the same gesture
135
+ * reversed. Everything else enters a state and stays there.
136
+ */
137
+ transition: margin var(--ion-duration-base) var(--ion-ease-in-out);
131
138
  }
132
139
 
133
140
  .ion-toggle__label {
@@ -288,7 +288,7 @@
288
288
  --surface-raised: #ffffff;
289
289
  --surface-overlay: #ffffff;
290
290
  --surface-scrim: rgba(0, 0, 0, 0.4);
291
- --surface-inverse: #131923;
291
+ --surface-inverse: #1d2735;
292
292
  --surface-inverse-subtle: #384252;
293
293
  --surface-disabled: #f0f2f4;
294
294
  --surface-placeholder: #dde0e4;
@@ -34,25 +34,25 @@
34
34
  0px 8px 8px -4px rgb(0 0 0 / 4%);
35
35
 
36
36
  --ion-shadow-raised-lifted-xs:
37
- inset 0px -2px 1px 0px rgb(0 0 0 / 40%),
37
+ inset 0px -2px 1px 0px rgb(0 0 0 / 25%),
38
38
  inset 0px 2px 1px 0px rgb(255 255 255 / 20%),
39
39
  0px 1px 1px 0px rgb(7 10 13 / 6%),
40
40
  0px 1px 2px 0px rgb(7 10 13 / 4%);
41
41
 
42
42
  --ion-shadow-raised-lifted-sm:
43
- inset 0px -3px 1px 0px rgb(0 0 0 / 30%),
43
+ inset 0px -3px 1px 0px rgb(0 0 0 / 25%),
44
44
  inset 0px 3px 1px 0px rgb(255 255 255 / 20%),
45
45
  0px 1px 2px 0px rgb(7 10 13 / 8%),
46
46
  0px 2px 4px 0px rgb(7 10 13 / 5%);
47
47
 
48
48
  --ion-shadow-raised-lifted-lg:
49
- inset 0px -4px 2px 0px rgb(0 0 0 / 40%),
49
+ inset 0px -4px 2px 0px rgb(0 0 0 / 25%),
50
50
  inset 0px 4px 2px 0px rgb(255 255 255 / 20%),
51
51
  0px 1px 1px 0px rgb(7 10 13 / 32%),
52
52
  0px 1px 2px 0px rgb(7 10 13 / 16%);
53
53
 
54
54
  --ion-shadow-raised-lifted-xl:
55
- inset 0px -6px 2px 0px rgb(0 0 0 / 35%),
55
+ inset 0px -6px 2px 0px rgb(0 0 0 / 25%),
56
56
  inset 0px 6px 2px 0px rgb(255 255 255 / 20%),
57
57
  0px 1px 2px 0px rgb(7 10 13 / 30%),
58
58
  0px 2px 4px 0px rgb(7 10 13 / 14%);
@@ -74,19 +74,19 @@
74
74
  0px 2px 6px 0px rgb(7 10 13 / 20%);
75
75
 
76
76
  --ion-shadow-raised-flush-xs:
77
- inset 0px -2px 1px 0px rgb(0 0 0 / 40%),
77
+ inset 0px -2px 1px 0px rgb(0 0 0 / 25%),
78
78
  inset 0px 2px 1px 0px rgb(255 255 255 / 20%);
79
79
 
80
80
  --ion-shadow-raised-flush-sm:
81
- inset 0px -3px 1px 0px rgb(0 0 0 / 30%),
81
+ inset 0px -3px 1px 0px rgb(0 0 0 / 25%),
82
82
  inset 0px 3px 1px 0px rgb(255 255 255 / 20%);
83
83
 
84
84
  --ion-shadow-raised-flush-lg:
85
- inset 0px -4px 2px 0px rgb(0 0 0 / 40%),
85
+ inset 0px -4px 2px 0px rgb(0 0 0 / 25%),
86
86
  inset 0px 4px 2px 0px rgb(255 255 255 / 20%);
87
87
 
88
88
  --ion-shadow-raised-flush-xl:
89
- inset 0px -6px 2px 0px rgb(0 0 0 / 35%),
89
+ inset 0px -6px 2px 0px rgb(0 0 0 / 25%),
90
90
  inset 0px 6px 2px 0px rgb(255 255 255 / 20%);
91
91
 
92
92
  --ion-shadow-inset-lifted-xs:
@@ -4,3 +4,4 @@
4
4
  @import "./breakpoint-mobile.css";
5
5
  @import "./typography.css";
6
6
  @import "./elevation.css";
7
+ @import "./motion.css";
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Generated from motion.json. Do not edit.
3
+ * Regenerate with `pnpm --filter @ionbase-ui/tokens build`.
4
+ *
5
+ * Source: motion.json (repo-owned — NOT a Figma export)
6
+ *
7
+ * These are NOT tokens. Figma expresses motion as prototype reactions rather
8
+ * than variables, so there is nothing for them to alias; the values are
9
+ * committed and generated instead. The `--ion-` prefix marks that, the same
10
+ * way it does for `--ion-shadow-*`.
11
+ *
12
+ * A LADDER, NOT RECIPES. Pick a rung per component. There is deliberately no
13
+ * `--ion-duration-hover`: that is indexed by usage, so it needs a new name
14
+ * per usage pattern.
15
+ *
16
+ * Reduced motion is handled globally in the package's index.css, not here —
17
+ * one block covering every `ion-*` rule, rather than a media query per value.
18
+ */
19
+
20
+ :root {
21
+ /* Press and release. Must resolve before the finger leaves the button, or */
22
+ /* the feedback reads as lag rather than as a press. */
23
+ --ion-duration-fast: 120ms;
24
+
25
+ /* The default for any state colour change — hover, focus, selection, */
26
+ /* validation. Replaces a hardcoded 150ms that read as abrupt. */
27
+ --ion-duration-base: 200ms;
28
+
29
+ /* Anything that travels or changes size: panels, overlays, disclosure. */
30
+ /* Distance needs time; a colour does not. */
31
+ --ion-duration-slow: 320ms;
32
+
33
+ /* The default. Leaves immediately and decelerates into the end state, so */
34
+ /* the change reads as settling. Correct for anything entering a state and */
35
+ /* staying there. */
36
+ --ion-ease-out: cubic-bezier(0.2, 0, 0, 1);
37
+
38
+ /* Accelerates and arrives at full velocity. Only for things leaving — */
39
+ /* dismissing an overlay, collapsing a panel. On a state a user is entering */
40
+ /* it reads as a snap. */
41
+ --ion-ease-in: cubic-bezier(0.4, 0, 1, 1);
42
+
43
+ /* Symmetric, for two-way travel where the same element moves back and */
44
+ /* forth — the Toggle knob. This is the curve every stylesheet used for */
45
+ /* everything, which is why state changes felt jerky. */
46
+ --ion-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
47
+
48
+ /* Continuous progress only, where easing would misreport position. Never */
49
+ /* for interaction. */
50
+ --ion-ease-linear: linear;
51
+ }
@@ -1093,7 +1093,7 @@ export declare const tokenValues: {
1093
1093
  readonly Dark: "{alpha.black-60}";
1094
1094
  };
1095
1095
  readonly "surface/inverse": {
1096
- readonly Light: "{neutral.900}";
1096
+ readonly Light: "{neutral.800}";
1097
1097
  readonly Dark: "{base.white}";
1098
1098
  };
1099
1099
  readonly "surface/inverse-subtle": {
@@ -698,7 +698,7 @@ export const tokenValues = {
698
698
  "Dark": "{alpha.black-60}"
699
699
  },
700
700
  "surface/inverse": {
701
- "Light": "{neutral.900}",
701
+ "Light": "{neutral.800}",
702
702
  "Dark": "{base.white}"
703
703
  },
704
704
  "surface/inverse-subtle": {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * JS token values as `var(--…)` string references.
3
+ *
4
+ * Prefer this subpath over the main barrel so importing a component does not
5
+ * pull ~48KB of token JSON into bundlers that do not tree-shake:
6
+ *
7
+ * import { semantic, tokens } from 'ionbase-ui/tokens-js';
8
+ *
9
+ * CSS custom properties stay at `ionbase-ui/tokens` / `ionbase-ui/styles`.
10
+ */
11
+ export * from './tokens/index.js';
12
+ //# sourceMappingURL=tokens-js.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens-js.d.ts","sourceRoot":"","sources":["../src/tokens-js.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * JS token values as `var(--…)` string references.
3
+ *
4
+ * Prefer this subpath over the main barrel so importing a component does not
5
+ * pull ~48KB of token JSON into bundlers that do not tree-shake:
6
+ *
7
+ * import { semantic, tokens } from 'ionbase-ui/tokens-js';
8
+ *
9
+ * CSS custom properties stay at `ionbase-ui/tokens` / `ionbase-ui/styles`.
10
+ */
11
+ export * from './tokens/index.js';
12
+ //# sourceMappingURL=tokens-js.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens-js.js","sourceRoot":"","sources":["../src/tokens-js.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ionbase-ui",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "IonBase Design System — accessible React components, styles and design tokens in one package",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,7 +14,11 @@
14
14
  "./styles": "./dist/styles/index.css",
15
15
  "./styles/*": "./dist/styles/*",
16
16
  "./tokens": "./dist/styles/tokens/index.css",
17
- "./tokens/*": "./dist/styles/tokens/*"
17
+ "./tokens/*": "./dist/styles/tokens/*",
18
+ "./tokens-js": {
19
+ "types": "./dist/tokens-js.d.ts",
20
+ "default": "./dist/tokens-js.js"
21
+ }
18
22
  },
19
23
  "keywords": [
20
24
  "design-system",
@@ -46,7 +50,7 @@
46
50
  },
47
51
  "scripts": {
48
52
  "dev": "tsc --watch",
49
- "build": "node scripts/sync-tokens.mjs && tsc --build --force && node scripts/copy-css.mjs",
53
+ "build": "node scripts/sync-tokens.mjs && tsc --build --force && node scripts/copy-css.mjs && node scripts/verify-client-boundaries.mjs",
50
54
  "typecheck": "tsc --noEmit",
51
55
  "lint": "eslint . && stylelint \"src/styles/*.css\"",
52
56
  "format": "prettier --check .",