@kanso-labs/kanso-ui 0.11.21 → 0.12.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 (89) hide show
  1. package/README.md +32 -8
  2. package/dist/components/app-bar/index.d.ts +2 -2
  3. package/dist/components/app-bar/index.js +1 -1
  4. package/dist/components/app-bar/index.js.map +1 -1
  5. package/dist/components/avatar/index.d.ts +4 -4
  6. package/dist/components/avatar/index.js +21 -15
  7. package/dist/components/avatar/index.js.map +1 -1
  8. package/dist/components/badge/index.d.ts +2 -2
  9. package/dist/components/badge/index.js +1 -1
  10. package/dist/components/badge/index.js.map +1 -1
  11. package/dist/components/button/index.d.ts +32 -21
  12. package/dist/components/button/index.js +75 -19
  13. package/dist/components/button/index.js.map +1 -1
  14. package/dist/components/card/index.d.ts +2 -2
  15. package/dist/components/card/index.js +1 -1
  16. package/dist/components/card/index.js.map +1 -1
  17. package/dist/components/chip/index.d.ts +5 -5
  18. package/dist/components/chip/index.js +5 -5
  19. package/dist/components/chip/index.js.map +1 -1
  20. package/dist/components/code/index.d.ts +2 -2
  21. package/dist/components/code/index.js +1 -1
  22. package/dist/components/code/index.js.map +1 -1
  23. package/dist/components/container/index.d.ts +2 -2
  24. package/dist/components/container/index.js +1 -1
  25. package/dist/components/container/index.js.map +1 -1
  26. package/dist/components/copy-field/index.js +1 -1
  27. package/dist/components/currency/index.d.ts +2 -2
  28. package/dist/components/currency/index.js +1 -1
  29. package/dist/components/currency/index.js.map +1 -1
  30. package/dist/components/feed/index.d.ts +2 -2
  31. package/dist/components/feed/index.js +1 -1
  32. package/dist/components/feed/index.js.map +1 -1
  33. package/dist/components/icon-button/index.d.ts +24 -18
  34. package/dist/components/icon-button/index.js +62 -15
  35. package/dist/components/icon-button/index.js.map +1 -1
  36. package/dist/components/index.d.ts +2 -1
  37. package/dist/components/keycap/index.d.ts +2 -2
  38. package/dist/components/keycap/index.js +1 -1
  39. package/dist/components/keycap/index.js.map +1 -1
  40. package/dist/components/link/index.d.ts +2 -2
  41. package/dist/components/link/index.js +1 -1
  42. package/dist/components/link/index.js.map +1 -1
  43. package/dist/components/list-detail/index.d.ts +2 -2
  44. package/dist/components/list-detail/index.js +1 -1
  45. package/dist/components/list-detail/index.js.map +1 -1
  46. package/dist/components/popover/index.d.ts +105 -0
  47. package/dist/components/popover/index.js +246 -0
  48. package/dist/components/popover/index.js.map +1 -0
  49. package/dist/components/product-icon/index.d.ts +3 -3
  50. package/dist/components/product-icon/index.js +23 -17
  51. package/dist/components/product-icon/index.js.map +1 -1
  52. package/dist/components/separator/index.d.ts +14 -4
  53. package/dist/components/separator/index.js +23 -9
  54. package/dist/components/separator/index.js.map +1 -1
  55. package/dist/components/sheet/index.d.ts +26 -28
  56. package/dist/components/sheet/index.js +47 -82
  57. package/dist/components/sheet/index.js.map +1 -1
  58. package/dist/components/stack/index.d.ts +2 -2
  59. package/dist/components/stack/index.js +1 -1
  60. package/dist/components/stack/index.js.map +1 -1
  61. package/dist/components/supporting-pane/index.d.ts +2 -2
  62. package/dist/components/supporting-pane/index.js +1 -1
  63. package/dist/components/supporting-pane/index.js.map +1 -1
  64. package/dist/components/tabs/index.d.ts +15 -8
  65. package/dist/components/tabs/index.js +133 -45
  66. package/dist/components/tabs/index.js.map +1 -1
  67. package/dist/components/text/index.d.ts +2 -2
  68. package/dist/components/text/index.js +1 -1
  69. package/dist/components/text/index.js.map +1 -1
  70. package/dist/components/text-field/index.d.ts +12 -5
  71. package/dist/components/text-field/index.js +48 -33
  72. package/dist/components/text-field/index.js.map +1 -1
  73. package/dist/hooks/useImageLoadingStatus.js +53 -0
  74. package/dist/hooks/useImageLoadingStatus.js.map +1 -0
  75. package/dist/hooks/useRipple.js +1 -1
  76. package/dist/hooks/useRipple.js.map +1 -1
  77. package/dist/index.d.ts +2 -1
  78. package/dist/index.js +2 -1
  79. package/dist/render/aria.js +66 -0
  80. package/dist/render/aria.js.map +1 -0
  81. package/dist/render/useRender.d.ts +28 -0
  82. package/dist/render/useRender.js +132 -0
  83. package/dist/render/useRender.js.map +1 -0
  84. package/dist/styles/merge.js +14 -8
  85. package/dist/styles/merge.js.map +1 -1
  86. package/dist/styles.css +88 -36
  87. package/package.json +4 -4
  88. package/dist/render/nativeButton.js +0 -26
  89. package/dist/render/nativeButton.js.map +0 -1
package/dist/styles.css CHANGED
@@ -23,6 +23,10 @@
23
23
  }
24
24
 
25
25
  @layer priority3 {
26
+ .xrh88j3 {
27
+ border-color: color-mix(in srgb,var(--xn0syi6) calc(var(--x1cq03z9) * 100%),transparent);
28
+ }
29
+
26
30
  .x9r1u3d {
27
31
  border-color: #0000;
28
32
  }
@@ -55,6 +59,10 @@
55
59
  border-radius: var(--x1kmbna2);
56
60
  }
57
61
 
62
+ .x62ce2h {
63
+ border-radius: var(--x1m0y4ip);
64
+ }
65
+
58
66
  .x1tfhd1 {
59
67
  border-radius: var(--x1qkrqlv);
60
68
  }
@@ -195,13 +203,13 @@
195
203
  text-decoration: none;
196
204
  }
197
205
 
198
- .xtecew7:active:not(:disabled) {
199
- border-radius: var(--x1m0y4ip);
200
- }
201
-
202
206
  .xd8uu4e:disabled {
203
207
  border-color: color-mix(in srgb,var(--xn0syi6) calc(var(--x1cq03z9) * 100%),transparent);
204
208
  }
209
+
210
+ .xtt5grq:active {
211
+ border-radius: var(--x1m0y4ip);
212
+ }
205
213
  }
206
214
 
207
215
  @layer priority4 {
@@ -237,6 +245,10 @@
237
245
  animation-duration: var(--x1neymab);
238
246
  }
239
247
 
248
+ .xvhm28k {
249
+ animation-duration: var(--xaryv6b);
250
+ }
251
+
240
252
  .xu2fq7p {
241
253
  animation-name: x17cjob-B;
242
254
  }
@@ -245,6 +257,10 @@
245
257
  animation-name: x18re5ia-B;
246
258
  }
247
259
 
260
+ .x97zbip {
261
+ animation-name: x1k48ry3-B;
262
+ }
263
+
248
264
  .x1yujl0p {
249
265
  animation-timing-function: var(--x77wm8g);
250
266
  }
@@ -361,6 +377,10 @@
361
377
  box-shadow: none;
362
378
  }
363
379
 
380
+ .x1os83gw {
381
+ box-shadow: var(--x14ermby);
382
+ }
383
+
364
384
  .x19efjv6 {
365
385
  box-shadow: var(--xt04dnm);
366
386
  }
@@ -947,10 +967,26 @@
947
967
  text-underline-offset: .2em;
948
968
  }
949
969
 
970
+ .x18ouj0k {
971
+ transform-origin: bottom;
972
+ }
973
+
950
974
  .x1g0ag68 {
951
975
  transform-origin: center;
952
976
  }
953
977
 
978
+ .x1nf803f {
979
+ transform-origin: 0;
980
+ }
981
+
982
+ .xyibjs4 {
983
+ transform-origin: 100%;
984
+ }
985
+
986
+ .x1dp6rp6 {
987
+ transform-origin: top;
988
+ }
989
+
954
990
  .xjl7l83 {
955
991
  transition-duration: .105s;
956
992
  }
@@ -1044,38 +1080,14 @@
1044
1080
  background-color: color-mix(in srgb,var(--x1cjupv7) calc(var(--x124j18r) * 100%),transparent);
1045
1081
  }
1046
1082
 
1047
- .x1pi8zt8:hover:not(:disabled) {
1048
- background-color: color-mix(in srgb,var(--x1cjupv7) calc(var(--x8z5t6h) * 100%),transparent);
1049
- }
1050
-
1051
- .x117izkb:active:not(:disabled) {
1052
- background-color: color-mix(in srgb,var(--x1cjupv7) calc(var(--xhaltwz) * 100%),transparent);
1053
- }
1054
-
1055
1083
  .x16z974x:focus-visible {
1056
1084
  background-color: color-mix(in srgb,var(--x1f7qwsz) calc(var(--x124j18r) * 100%),var(--x1cjupv7));
1057
1085
  }
1058
1086
 
1059
- .x197hsbc:hover:not(:disabled) {
1060
- background-color: color-mix(in srgb,var(--x1f7qwsz) calc(var(--x8z5t6h) * 100%),var(--x1cjupv7));
1061
- }
1062
-
1063
- .xm7dzmu:active:not(:disabled) {
1064
- background-color: color-mix(in srgb,var(--x1f7qwsz) calc(var(--xhaltwz) * 100%),var(--x1cjupv7));
1065
- }
1066
-
1067
1087
  .x1uyy5zb:focus-visible {
1068
1088
  background-color: color-mix(in srgb,var(--x1p425jc) calc(var(--x124j18r) * 100%),var(--x17f4f9w));
1069
1089
  }
1070
1090
 
1071
- .xwypj8i:hover:not(:disabled) {
1072
- background-color: color-mix(in srgb,var(--x1p425jc) calc(var(--x8z5t6h) * 100%),var(--x17f4f9w));
1073
- }
1074
-
1075
- .x1c3n7wt:active:not(:disabled) {
1076
- background-color: color-mix(in srgb,var(--x1p425jc) calc(var(--xhaltwz) * 100%),var(--x17f4f9w));
1077
- }
1078
-
1079
1091
  .x6gcojk:hover:not(:disabled) {
1080
1092
  background-color: color-mix(in srgb,var(--xn0syi6) calc(var(--x8z5t6h) * 100%),transparent);
1081
1093
  }
@@ -1092,14 +1104,6 @@
1092
1104
  box-shadow: inset 0 -2px 0 0 var(--x1cjupv7);
1093
1105
  }
1094
1106
 
1095
- .xfj5659:active:not(:disabled) {
1096
- box-shadow: none;
1097
- }
1098
-
1099
- .xv7jn9b:hover:not(:disabled) {
1100
- box-shadow: var(--xt04dnm);
1101
- }
1102
-
1103
1107
  .x9v5kkp:focus-visible {
1104
1108
  outline-style: solid;
1105
1109
  }
@@ -1116,6 +1120,14 @@
1116
1120
  cursor: not-allowed;
1117
1121
  }
1118
1122
 
1123
+ .x14dcer4:hover {
1124
+ background-color: color-mix(in srgb,var(--x1cjupv7) calc(var(--x8z5t6h) * 100%),transparent);
1125
+ }
1126
+
1127
+ .xyf7a0q:hover {
1128
+ background-color: color-mix(in srgb,var(--x1f7qwsz) calc(var(--x8z5t6h) * 100%),var(--x1cjupv7));
1129
+ }
1130
+
1119
1131
  .x1hei0q8:hover {
1120
1132
  background-color: color-mix(in srgb,var(--x1p425jc) calc(var(--x8z5t6h) * 100%),var(--x17f4f9w));
1121
1133
  }
@@ -1140,6 +1152,10 @@
1140
1152
  box-shadow: var(--x14ermby);
1141
1153
  }
1142
1154
 
1155
+ .x1955hzl:hover {
1156
+ box-shadow: var(--xt04dnm);
1157
+ }
1158
+
1143
1159
  .x1aetzt3:hover {
1144
1160
  color: var(--x1cjupv7);
1145
1161
  }
@@ -1153,6 +1169,18 @@
1153
1169
  text-decoration-line: underline;
1154
1170
  }
1155
1171
 
1172
+ .x12vej0r:active {
1173
+ background-color: color-mix(in srgb,var(--x1cjupv7) calc(var(--xhaltwz) * 100%),transparent);
1174
+ }
1175
+
1176
+ .xpky1to:active {
1177
+ background-color: color-mix(in srgb,var(--x1f7qwsz) calc(var(--xhaltwz) * 100%),var(--x1cjupv7));
1178
+ }
1179
+
1180
+ .xxwd9aw:active {
1181
+ background-color: color-mix(in srgb,var(--x1p425jc) calc(var(--xhaltwz) * 100%),var(--x17f4f9w));
1182
+ }
1183
+
1156
1184
  .x83qkoq:active {
1157
1185
  background-color: color-mix(in srgb,var(--xn0syi6) calc(var(--xhaltwz) * 100%),transparent);
1158
1186
  }
@@ -1169,6 +1197,10 @@
1169
1197
  background-color: color-mix(in srgb,var(--xn0syi6) calc(var(--xhaltwz) * 100%),var(--xi1exwt));
1170
1198
  }
1171
1199
 
1200
+ .xpk4wdd:active {
1201
+ box-shadow: none;
1202
+ }
1203
+
1172
1204
  .x1g60mc1:active {
1173
1205
  box-shadow: var(--xt04dnm);
1174
1206
  }
@@ -1253,6 +1285,14 @@
1253
1285
  max-height: none;
1254
1286
  }
1255
1287
 
1288
+ .xjjheoa {
1289
+ max-width: min(240px, 100vw);
1290
+ }
1291
+
1292
+ .x10u2fgw {
1293
+ max-width: min(320px, 100vw);
1294
+ }
1295
+
1256
1296
  .x13i5qev {
1257
1297
  max-width: var(--x-maxInlineSize);
1258
1298
  }
@@ -1422,6 +1462,18 @@
1422
1462
  }
1423
1463
  }
1424
1464
 
1465
+ @keyframes x1k48ry3-B {
1466
+ from {
1467
+ opacity: 0;
1468
+ transform: scale(.95);
1469
+ }
1470
+
1471
+ to {
1472
+ opacity: 1;
1473
+ transform: scale(1);
1474
+ }
1475
+ }
1476
+
1425
1477
  @keyframes x17cjob-B {
1426
1478
  from {
1427
1479
  opacity: 0;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@kanso-labs/kanso-ui",
3
- "version": "0.11.21",
4
- "description": "A React component library built on Base UI primitives and styled with StyleX, with design tokens sourced from a single W3C DTCG file and compiled via Style Dictionary",
3
+ "version": "0.12.0",
4
+ "description": "A React component library built on React Aria Components primitives and styled with StyleX, with design tokens sourced from a single W3C DTCG file and compiled via Style Dictionary",
5
5
  "keywords": [
6
6
  "react",
7
7
  "component-library",
8
8
  "design-system",
9
- "base-ui",
9
+ "react-aria",
10
10
  "stylex",
11
11
  "design-tokens",
12
12
  "style-dictionary",
@@ -58,7 +58,7 @@
58
58
  "tokens:build": "node scripts/build-tokens.mjs"
59
59
  },
60
60
  "dependencies": {
61
- "@base-ui/react": "1.7.0"
61
+ "react-aria-components": "1.21.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@babel/core": "8.0.1",
@@ -1,26 +0,0 @@
1
- //#region src/render/nativeButton.ts
2
- /**
3
- * Whether the element a `render` prop produces is a real `<button>`.
4
- *
5
- * Base UI needs this: a `<button>` already announces its role, activates on
6
- * Space and Enter, and takes `disabled`, while an `<a>` or a `<div>` has to be
7
- * given all three by hand. It cannot see through `render` to find out, so it
8
- * assumes a native button and logs an error when the DOM turns out to
9
- * disagree — which is what `<Button render={<a href="…" />}>` used to produce
10
- * unless the call site knew to pass `nativeButton={false}`.
11
- *
12
- * Only a plain element with a host tag is decided here. A `render` that is a
13
- * function, or an element whose type is a component, could still return a
14
- * `<button>`, and treating one as a non-button would hand a real button the
15
- * role, tab index and keyboard handling it already has. Those keep Base UI's
16
- * own default, which is where its error message — and an explicit
17
- * `nativeButton` at the call site — remain the answer.
18
- */
19
- function rendersNativeButton(render) {
20
- if (render !== void 0 && typeof render !== "function" && typeof render.type === "string") return render.type === "button";
21
- return true;
22
- }
23
- //#endregion
24
- export { rendersNativeButton };
25
-
26
- //# sourceMappingURL=nativeButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nativeButton.js","names":[],"sources":["../../src/render/nativeButton.ts"],"sourcesContent":["import type { ReactElement } from 'react'\n\n/**\n * Whether the element a `render` prop produces is a real `<button>`.\n *\n * Base UI needs this: a `<button>` already announces its role, activates on\n * Space and Enter, and takes `disabled`, while an `<a>` or a `<div>` has to be\n * given all three by hand. It cannot see through `render` to find out, so it\n * assumes a native button and logs an error when the DOM turns out to\n * disagree — which is what `<Button render={<a href=\"…\" />}>` used to produce\n * unless the call site knew to pass `nativeButton={false}`.\n *\n * Only a plain element with a host tag is decided here. A `render` that is a\n * function, or an element whose type is a component, could still return a\n * `<button>`, and treating one as a non-button would hand a real button the\n * role, tab index and keyboard handling it already has. Those keep Base UI's\n * own default, which is where its error message — and an explicit\n * `nativeButton` at the call site — remain the answer.\n */\nfunction rendersNativeButton(\n render: ((...args: never) => unknown) | ReactElement | undefined,\n) {\n if (\n render !== undefined &&\n typeof render !== 'function' &&\n typeof render.type === 'string'\n ) {\n return render.type === 'button'\n }\n return true\n}\n\nexport { rendersNativeButton }\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,SAAS,oBACP,QACA;CACA,IACE,WAAW,KAAA,KACX,OAAO,WAAW,cAClB,OAAO,OAAO,SAAS,UAEvB,OAAO,OAAO,SAAS;CAEzB,OAAO;AACT"}