@kanso-labs/react-native-kanso-ui 0.3.1 → 0.5.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 (123) hide show
  1. package/dist/autocomplete/index.js +39 -0
  2. package/dist/autocomplete/index.js.map +1 -0
  3. package/dist/button/index.d.ts +2 -1
  4. package/dist/button/index.js +35 -2
  5. package/dist/button/index.js.map +1 -1
  6. package/dist/button/pending.js +1 -1
  7. package/dist/button/slots.d.ts +2 -0
  8. package/dist/button/slots.js.map +1 -1
  9. package/dist/chip/index.js +1 -1
  10. package/dist/components/autocomplete/index.d.ts +49 -0
  11. package/dist/components/autocomplete/index.js +87 -0
  12. package/dist/components/autocomplete/index.js.map +1 -0
  13. package/dist/components/avatar/index.d.ts +1 -1
  14. package/dist/components/button/index.d.ts +2 -2
  15. package/dist/components/button/index.js +196 -150
  16. package/dist/components/button/index.js.map +1 -1
  17. package/dist/components/card/index.d.ts +1 -1
  18. package/dist/components/card/index.js +1 -1
  19. package/dist/components/checkbox/index.d.ts +1 -1
  20. package/dist/components/checkbox/index.js +106 -193
  21. package/dist/components/checkbox/index.js.map +1 -1
  22. package/dist/components/chip/index.d.ts +1 -1
  23. package/dist/components/chip-group/index.d.ts +1 -1
  24. package/dist/components/chip-group/index.js +1 -1
  25. package/dist/components/copy-field/index.d.ts +1 -1
  26. package/dist/components/copy-field/index.js +1 -1
  27. package/dist/components/currency/index.d.ts +1 -1
  28. package/dist/components/currency/index.js +1 -1
  29. package/dist/components/dialog/index.d.ts +3 -2
  30. package/dist/components/dialog/index.js +105 -242
  31. package/dist/components/dialog/index.js.map +1 -1
  32. package/dist/components/icon-button/index.d.ts +2 -2
  33. package/dist/components/icon-button/index.js +205 -159
  34. package/dist/components/icon-button/index.js.map +1 -1
  35. package/dist/components/link/index.d.ts +1 -1
  36. package/dist/components/link/index.js +1 -1
  37. package/dist/components/list/index.d.ts +216 -0
  38. package/dist/components/list/index.js +1118 -0
  39. package/dist/components/list/index.js.map +1 -0
  40. package/dist/components/list-item/index.d.ts +63 -0
  41. package/dist/components/list-item/index.js +275 -0
  42. package/dist/components/list-item/index.js.map +1 -0
  43. package/dist/components/menu/index.d.ts +309 -0
  44. package/dist/components/menu/index.js +1283 -0
  45. package/dist/components/menu/index.js.map +1 -0
  46. package/dist/components/meter/index.d.ts +1 -1
  47. package/dist/components/meter/index.js +1 -1
  48. package/dist/components/number-field/index.d.ts +1 -1
  49. package/dist/components/number-field/index.js +2 -2
  50. package/dist/components/popover/index.d.ts +140 -0
  51. package/dist/components/popover/index.js +704 -0
  52. package/dist/components/popover/index.js.map +1 -0
  53. package/dist/components/product-icon/index.d.ts +1 -1
  54. package/dist/components/progress-indicator/index.d.ts +1 -1
  55. package/dist/components/progress-indicator/index.js +1 -1
  56. package/dist/components/radio-group/index.d.ts +1 -1
  57. package/dist/components/radio-group/index.js +1 -1
  58. package/dist/components/search-field/index.d.ts +12 -4
  59. package/dist/components/search-field/index.js +64 -58
  60. package/dist/components/search-field/index.js.map +1 -1
  61. package/dist/components/segmented-button/index.d.ts +1 -1
  62. package/dist/components/segmented-button/index.js +1 -1
  63. package/dist/components/separator/index.d.ts +1 -1
  64. package/dist/components/separator/index.js +1 -1
  65. package/dist/components/sheet/index.d.ts +137 -0
  66. package/dist/components/sheet/index.js +1091 -0
  67. package/dist/components/sheet/index.js.map +1 -0
  68. package/dist/components/snackbar/index.d.ts +1 -1
  69. package/dist/components/snackbar/index.js +1 -1
  70. package/dist/components/stack/index.d.ts +1 -1
  71. package/dist/components/stack/index.js +1 -1
  72. package/dist/components/switch/index.d.ts +1 -1
  73. package/dist/components/switch/index.js +1 -1
  74. package/dist/components/switch/index.js.map +1 -1
  75. package/dist/components/text/index.d.ts +1 -1
  76. package/dist/components/text/index.js +1 -1
  77. package/dist/components/text-field/index.d.ts +1 -1
  78. package/dist/components/text-field/index.js +1 -1
  79. package/dist/control/checkbox-box.js +137 -0
  80. package/dist/control/checkbox-box.js.map +1 -0
  81. package/dist/control/index.js +1 -1
  82. package/dist/field/index.d.ts +1 -1
  83. package/dist/field/index.js +1 -1
  84. package/dist/form/index.d.ts +1 -1
  85. package/dist/glyphs/index.js +21 -2
  86. package/dist/glyphs/index.js.map +1 -1
  87. package/dist/i18n/index.js +16 -1
  88. package/dist/i18n/index.js.map +1 -1
  89. package/dist/i18n/messages.js +374 -34
  90. package/dist/i18n/messages.js.map +1 -1
  91. package/dist/index.d.ts +7 -1
  92. package/dist/index.js +8 -2
  93. package/dist/indicator/index.d.ts +1 -1
  94. package/dist/indicator/index.js +2 -2
  95. package/dist/mark/index.d.ts +1 -1
  96. package/dist/mark/index.js +1 -1
  97. package/dist/modal/index.d.ts +16 -0
  98. package/dist/modal/index.js +277 -0
  99. package/dist/modal/index.js.map +1 -0
  100. package/dist/overlay/anchored.d.ts +2 -0
  101. package/dist/overlay/anchored.js +182 -0
  102. package/dist/overlay/anchored.js.map +1 -0
  103. package/dist/overlay/host.d.ts +2 -0
  104. package/dist/overlay/host.js +1 -1
  105. package/dist/overlay/index.d.ts +4 -0
  106. package/dist/overlay/panel.js +215 -0
  107. package/dist/overlay/panel.js.map +1 -0
  108. package/dist/overlay/placement.d.ts +8 -0
  109. package/dist/overlay/placement.js +87 -0
  110. package/dist/overlay/placement.js.map +1 -0
  111. package/dist/press/index.js +1 -1
  112. package/dist/ref/index.js +15 -0
  113. package/dist/ref/index.js.map +1 -0
  114. package/dist/router/index.js +1 -1
  115. package/dist/row/index.js +158 -0
  116. package/dist/row/index.js.map +1 -0
  117. package/dist/row/styles.js +51 -0
  118. package/dist/row/styles.js.map +1 -0
  119. package/dist/theme/scope.js +1 -1
  120. package/dist/theme-scope.d.ts +1 -1
  121. package/dist/theme-scope.js +1 -1
  122. package/dist/typography/fonts.js +1 -1
  123. package/package.json +6 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","names":["StyleSheet","ResolvedTheme","withOpacity","themedStyles","RowVariant","rowStylesOf","colors","sizing","spacing","create","base","alignItems","flexDirection","gap","lg","paddingHorizontal","paddingVertical","md","list","minHeight","rowSm","main","flexGrow","flexShrink","xxs","minWidth","menu","rowXs","muted","color","onSurfaceVariant","selectedList","backgroundColor","primaryContainer","selectedMenu","tertiaryContainer","threeLine","rowLg","twoLine","rowMd","rowStyles","ring","outlineOffset","slot","justifyContent","rowContentColor","stateLayerOpacity","isDisabled","isSelected","variant","onSurface","disabledContent","onTertiaryContainer","onPrimaryContainer"],"sources":["../../src/row/styles.ts"],"sourcesContent":["import { StyleSheet } from 'react-native'\n\nimport type { ResolvedTheme } from '../theme/scope'\n\nimport { withOpacity } from '../theme/color'\nimport { themedStyles } from '../theme/styles'\n\n// The row every list and menu item draws, as web's src/row draws it: the\n// lists page's 16dp inline and 12dp block padding, 16dp between the slots\n// and the text, and a height per spec page and line count. Each height is a\n// `minHeight`, since the lines inside are set in type roles whose sizes are\n// tokens, and a larger OS text size grows the row rather than clipping it.\n\n/** Which spec page's row this is: the lists page's or the menus page's. */\ntype RowVariant = 'list' | 'menu'\n\nconst rowStylesOf = themedStyles(({ colors, sizing, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n base: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: spacing.lg,\n paddingHorizontal: spacing.lg,\n paddingVertical: spacing.md,\n },\n // The lists page's one-line item.\n list: {\n minHeight: sizing.rowSm,\n },\n // The headline and the lines beside it take what the slots leave and\n // wrap past it, so a long one never runs under the trailing slot.\n // `minWidth: 0` is for React Native Web, where a text in a row keeps\n // CSS's automatic minimum, the width of its longest word.\n main: {\n flexGrow: 1,\n flexShrink: 1,\n gap: spacing.xxs,\n minWidth: 0,\n },\n // The menus page's item.\n menu: {\n minHeight: sizing.rowXs,\n },\n muted: {\n color: colors.onSurfaceVariant,\n },\n selectedList: {\n backgroundColor: colors.primaryContainer,\n },\n selectedMenu: {\n backgroundColor: colors.tertiaryContainer,\n },\n // The three-line item, the only one whose slots move: they are held\n // level with the overline rather than centred on the three lines.\n threeLine: {\n alignItems: 'flex-start',\n minHeight: sizing.rowLg,\n },\n twoLine: {\n minHeight: sizing.rowMd,\n },\n }),\n)\n\nconst rowStyles = StyleSheet.create({\n // The focus ring, drawn inside the row as web's is, so a container that\n // clips its rows, such as a menu's surface, leaves the whole ring showing.\n ring: {\n outlineOffset: -2,\n },\n slot: {\n alignItems: 'center',\n flexShrink: 0,\n justifyContent: 'center',\n },\n})\n\n/**\n * The colour a row's headline, slots and feedback are drawn in: on surface,\n * the selected container's own on-colour, or on surface faded to the\n * disabled content opacity, which wins over the selected one.\n */\nfunction rowContentColor(\n { colors, stateLayerOpacity }: ResolvedTheme,\n {\n isDisabled = false,\n isSelected = false,\n variant = 'list',\n }: {\n readonly isDisabled?: boolean\n readonly isSelected?: boolean\n readonly variant?: RowVariant\n },\n): string {\n if (isDisabled) {\n return withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n }\n if (isSelected) {\n return variant === 'menu'\n ? colors.onTertiaryContainer\n : colors.onPrimaryContainer\n }\n return colors.onSurface\n}\n\nexport type { RowVariant }\n\nexport { rowContentColor, rowStyles, rowStylesOf }\n"],"mappings":";;;;AAgBA,MAAMK,cAAcF,cAAc,EAAEG,QAAQC,QAAQC,cAClDR,WAAWS,OAAO;CAChBC,MAAM;EACJC,YAAY;EACZC,eAAe;EACfC,KAAKL,QAAQM;EACbC,mBAAmBP,QAAQM;EAC3BE,iBAAiBR,QAAQS;CAC3B;CAEAC,MAAM,EACJC,WAAWZ,OAAOa,MACpB;CAKAC,MAAM;EACJC,UAAU;EACVC,YAAY;EACZV,KAAKL,QAAQgB;EACbC,UAAU;CACZ;CAEAC,MAAM,EACJP,WAAWZ,OAAOoB,MACpB;CACAC,OAAO,EACLC,OAAOvB,OAAOwB,iBAChB;CACAC,cAAc,EACZC,iBAAiB1B,OAAO2B,iBAC1B;CACAC,cAAc,EACZF,iBAAiB1B,OAAO6B,kBAC1B;CAGAC,WAAW;EACTzB,YAAY;EACZQ,WAAWZ,OAAO8B;CACpB;CACAC,SAAS,EACPnB,WAAWZ,OAAOgC,MACpB;AACF,CAAC,CACH;AAEA,MAAMC,YAAYxC,WAAWS,OAAO;CAGlCgC,MAAM,EACJC,eAAe,GACjB;CACAC,MAAM;EACJhC,YAAY;EACZY,YAAY;EACZqB,gBAAgB;CAClB;AACF,CAAC;;;;;;AAOD,SAASC,gBACP,EAAEvC,QAAQwC,qBACV,EACEC,aAAa,OACbC,aAAa,OACbC,UAAU,UAMJ;CACR,IAAIF,YACF,OAAO7C,YAAYI,OAAO4C,WAAWJ,kBAAkBK,eAAe;CAExE,IAAIH,YACF,OAAOC,YAAY,SACf3C,OAAO8C,sBACP9C,OAAO+C;CAEb,OAAO/C,OAAO4C;AAChB"}
@@ -1,8 +1,8 @@
1
1
  import { dark, light } from "../tokens/defaults.js";
2
2
  import { resolveTheme } from "./resolve.js";
3
3
  import { c } from "react/compiler-runtime";
4
- import { useColorScheme } from "react-native";
5
4
  import { createContext, use } from "react";
5
+ import { useColorScheme } from "react-native";
6
6
  //#region src/theme/scope.ts
7
7
  const DEFAULTS = {
8
8
  dark,
@@ -1,6 +1,6 @@
1
1
  import { KuiTheme } from "./tokens/defaults.js";
2
- import { View, ViewProps } from "react-native";
3
2
  import { ComponentRef, Ref } from "react";
3
+ import { View, ViewProps } from "react-native";
4
4
  //#region src/theme-scope.d.ts
5
5
  type ThemeScopeProps = ViewProps & {
6
6
  readonly ref?: Ref<ComponentRef<typeof View>>;
@@ -2,9 +2,9 @@ import { ScopeContext, merged, scopeFor, useScope } from "./theme/scope.js";
2
2
  import { themedStyles } from "./theme/styles.js";
3
3
  import { OverlayHost, OverlayHostContext } from "./overlay/host.js";
4
4
  import { c } from "react/compiler-runtime";
5
- import { StyleSheet, View } from "react-native";
6
5
  import { use } from "react";
7
6
  import { jsx } from "react/jsx-runtime";
7
+ import { StyleSheet, View } from "react-native";
8
8
  //#region src/theme-scope.tsx
9
9
  const stylesOf = themedStyles(({ colors }) => StyleSheet.create({ pinned: { backgroundColor: colors.surface } }));
10
10
  /**
@@ -1,6 +1,6 @@
1
1
  import { c } from "react/compiler-runtime";
2
- import { Platform } from "react-native";
3
2
  import { useSyncExternalStore } from "react";
3
+ import { Platform } from "react-native";
4
4
  //#region src/typography/fonts.ts
5
5
  let registry;
6
6
  let loading;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanso-labs/react-native-kanso-ui",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "description": "Kanso UI's Material Design components for React Native, themed through the same --kui-* design tokens as the web library",
5
5
  "keywords": [
6
6
  "react-native",
@@ -61,8 +61,8 @@
61
61
  "@commitlint/config-conventional": "21.2.3",
62
62
  "@eslint/js": "10.0.1",
63
63
  "@jest/globals": "29.7.0",
64
- "@kanso-labs/kanso-ui": "0.43.4",
65
- "@kanso-labs/unplugin-style-dictionary": "0.10.31",
64
+ "@kanso-labs/kanso-ui": "0.43.5",
65
+ "@kanso-labs/unplugin-style-dictionary": "0.10.33",
66
66
  "@react-native/babel-preset": "0.88.0",
67
67
  "@react-native/jest-preset": "0.88.0",
68
68
  "@rolldown/plugin-babel": "0.2.4",
@@ -76,7 +76,7 @@
76
76
  "@types/react": "19.3.0",
77
77
  "@vitest/browser-playwright": "5.0.5",
78
78
  "babel-plugin-react-compiler": "1.0.0",
79
- "eslint": "10.12.0",
79
+ "eslint": "10.13.0",
80
80
  "eslint-plugin-oxlint": "1.88.0",
81
81
  "eslint-plugin-perfectionist": "5.12.1",
82
82
  "eslint-plugin-react-hooks": "7.1.1",
@@ -93,10 +93,10 @@
93
93
  "react": "19.3.1",
94
94
  "react-dom": "19.3.1",
95
95
  "react-native": "0.88.0",
96
- "react-native-gesture-handler": "2.33.0",
96
+ "react-native-gesture-handler": "3.4.0",
97
97
  "react-native-reanimated": "4.7.1",
98
98
  "react-native-safe-area-context": "5.10.1",
99
- "react-native-svg": "15.15.5",
99
+ "react-native-svg": "15.16.0",
100
100
  "react-native-web": "0.21.4",
101
101
  "react-native-worklets": "0.13.0",
102
102
  "storybook": "10.6.2",