@kanso-labs/react-native-kanso-ui 0.6.0 → 0.8.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 +37 -0
- package/dist/badge/index.js +25 -23
- package/dist/badge/index.js.map +1 -1
- package/dist/button/index.d.ts +2 -1
- package/dist/button/index.js.map +1 -1
- package/dist/button/pending.js +17 -21
- package/dist/button/pending.js.map +1 -1
- package/dist/calendar/index.js +1182 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/calendar/styles.js +120 -0
- package/dist/calendar/styles.js.map +1 -0
- package/dist/components/autocomplete/index.js +28 -26
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js +2 -2
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +51 -0
- package/dist/components/calendar/index.js +121 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/dist/components/chip-group/index.d.ts +4 -3
- package/dist/components/chip-group/index.js +47 -45
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/copy-field/index.d.ts +5 -5
- package/dist/components/copy-field/index.js +30 -28
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/currency/index.d.ts +2 -2
- package/dist/components/currency/index.js +3 -1
- package/dist/components/currency/index.js.map +1 -1
- package/dist/components/list/index.d.ts +6 -5
- package/dist/components/list/index.js +97 -106
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +4 -3
- package/dist/components/menu/index.js +33 -40
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +2 -1
- package/dist/components/meter/index.js +9 -7
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-bar/index.d.ts +3 -9
- package/dist/components/navigation-bar/index.js +10 -34
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-rail/index.d.ts +68 -0
- package/dist/components/navigation-rail/index.js +294 -0
- package/dist/components/navigation-rail/index.js.map +1 -0
- package/dist/components/number-field/index.d.ts +7 -3
- package/dist/components/number-field/index.js +214 -192
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/product-icon/index.d.ts +2 -2
- package/dist/components/product-icon/index.js +2 -2
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +2 -1
- package/dist/components/progress-indicator/index.js +15 -13
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +3 -3
- package/dist/components/search-field/index.js +105 -104
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +2 -2
- package/dist/components/sheet/index.js +22 -26
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +3 -3
- package/dist/components/snackbar/index.js +36 -34
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/tag/index.d.ts +58 -0
- package/dist/components/tag/index.js +205 -0
- package/dist/components/tag/index.js.map +1 -0
- package/dist/components/text-field/index.d.ts +6 -3
- package/dist/components/text-field/index.js +3 -0
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/field/index.js +39 -36
- package/dist/field/index.js.map +1 -1
- package/dist/glyphs/index.js +19 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/i18n/index.js +12 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +741 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/i18n/provider.d.ts +53 -0
- package/dist/i18n/provider.js +96 -0
- package/dist/i18n/provider.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +6 -2
- package/dist/indicator/index.js +1 -2
- package/dist/indicator/index.js.map +1 -1
- package/dist/mark/index.js +77 -117
- package/dist/mark/index.js.map +1 -1
- package/dist/mark/initials.js.map +1 -1
- package/dist/navigation/index.d.ts +8 -1
- package/dist/navigation/index.js +113 -64
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/styles.js +22 -0
- package/dist/navigation/styles.js.map +1 -1
- package/dist/number/count.js +15 -0
- package/dist/number/count.js.map +1 -0
- package/dist/number/locale.js.map +1 -1
- package/dist/overlay/host.js +30 -21
- package/dist/overlay/host.js.map +1 -1
- package/package.json +3 -2
package/dist/overlay/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","names":["ComponentRef","ReactNode","createContext","use","useId","useLayoutEffect","useState","useSyncExternalStore","StyleSheet","View","ScopeContext","useScope","Entry","key","content","OverlayStore","attach","layer","entries","remove","set","subscribe","listener","OverlayHostContext","styles","create","fill","bottom","left","pointerEvents","position","right","top","Overlay","t0","$","_c","children","store","scope","Error","t1","t2","t3","t4","OverlayHost","storeFor","OverlayLayer","map","_temp","Map","listeners","Set","changed","view","delete","node","add","_c"],"sources":["../../src/overlay/host.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode } from 'react'\n\nimport {\n createContext,\n use,\n useId,\n useLayoutEffect,\n useState,\n useSyncExternalStore,\n} from 'react'\nimport { StyleSheet, View } from 'react-native'\n\nimport { ScopeContext, useScope } from '../theme/scope'\n\ntype Entry = readonly [key: string, content: ReactNode]\n\n/** What an overlay reaches its host through. */\ntype OverlayStore = {\n /** Takes the layer the host draws its overlays in, as its ref. */\n readonly attach: (layer: ComponentRef<typeof View> | null) => void\n readonly entries: () => readonly Entry[]\n /** The layer the host draws its overlays in, for placing one in it. */\n readonly layer: () => ComponentRef<typeof View> | null\n readonly remove: (key: string) => void\n readonly set: (key: string, content: ReactNode) => void\n readonly subscribe: (listener: () => void) => () => void\n}\n\nconst OverlayHostContext = createContext<null | OverlayStore>(null)\n\nconst styles = StyleSheet.create({\n // Each overlay fills the layer on a box of its own, so one laid out in the\n // flow, as a bar along an edge is, is laid out against the screen rather\n // than after the overlay before it.\n fill: {\n bottom: 0,\n left: 0,\n pointerEvents: 'box-none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n})\n\n/**\n * Draws its content above the screen, in the overlay host of the app's\n * outermost `ThemeScope`, for as long as it is mounted. A later overlay draws\n * above an earlier one.\n *\n * The content reads the `ThemeScope` around the `Overlay`, as anything else\n *
|
|
1
|
+
{"version":3,"file":"host.js","names":["ComponentRef","ReactNode","createContext","use","useId","useLayoutEffect","useState","useSyncExternalStore","StyleSheet","View","I18nProvider","useProvidedLocale","ScopeContext","useScope","Entry","key","content","OverlayStore","attach","layer","entries","remove","set","subscribe","listener","OverlayHostContext","styles","create","fill","bottom","left","pointerEvents","position","right","top","Overlay","t0","$","_c","children","store","scope","locale","Error","t1","t2","t3","t4","OverlayHost","storeFor","OverlayLayer","map","_temp","Map","listeners","Set","changed","view","delete","node","add","_c"],"sources":["../../src/overlay/host.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode } from 'react'\n\nimport {\n createContext,\n use,\n useId,\n useLayoutEffect,\n useState,\n useSyncExternalStore,\n} from 'react'\nimport { StyleSheet, View } from 'react-native'\n\nimport { I18nProvider, useProvidedLocale } from '../i18n/provider'\nimport { ScopeContext, useScope } from '../theme/scope'\n\ntype Entry = readonly [key: string, content: ReactNode]\n\n/** What an overlay reaches its host through. */\ntype OverlayStore = {\n /** Takes the layer the host draws its overlays in, as its ref. */\n readonly attach: (layer: ComponentRef<typeof View> | null) => void\n readonly entries: () => readonly Entry[]\n /** The layer the host draws its overlays in, for placing one in it. */\n readonly layer: () => ComponentRef<typeof View> | null\n readonly remove: (key: string) => void\n readonly set: (key: string, content: ReactNode) => void\n readonly subscribe: (listener: () => void) => () => void\n}\n\nconst OverlayHostContext = createContext<null | OverlayStore>(null)\n\nconst styles = StyleSheet.create({\n // Each overlay fills the layer on a box of its own, so one laid out in the\n // flow, as a bar along an edge is, is laid out against the screen rather\n // than after the overlay before it.\n fill: {\n bottom: 0,\n left: 0,\n pointerEvents: 'box-none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n})\n\n/**\n * Draws its content above the screen, in the overlay host of the app's\n * outermost `ThemeScope`, for as long as it is mounted. A later overlay draws\n * above an earlier one.\n *\n * The content reads the `ThemeScope` and the `I18nProvider` around the\n * `Overlay`, as anything else there would, so a dialog writes in the locale\n * of the screen that opened it, as web's portal does. Other context set\n * between the host and the `Overlay` does not reach it: an overlay is a\n * surface of its own, as web's `OverlayScope` makes one, so it starts from\n * what is around the app rather than from what is around the control that\n * opened it.\n */\nfunction Overlay({ children }: { readonly children?: ReactNode }) {\n const store = use(OverlayHostContext)\n const scope = useScope()\n const locale = useProvidedLocale()\n const key = useId()\n\n if (store === null) {\n throw new Error(\n 'An overlay draws in the host of the outermost ThemeScope, and there is no ThemeScope around this one. Wrap the app in a ThemeScope.',\n )\n }\n\n // Set before paint, so an overlay opening never draws a frame without it,\n // and replaced in place on an update, so it keeps its place in the stack.\n useLayoutEffect(() => {\n store.set(\n key,\n <ScopeContext value={scope}>\n <I18nProvider locale={locale}>{children}</I18nProvider>\n </ScopeContext>,\n )\n }, [children, key, locale, scope, store])\n\n useLayoutEffect(\n () => () => {\n store.remove(key)\n },\n [key, store],\n )\n\n return null\n}\n\n/**\n * Hosts the overlays drawn inside it: its children, then a layer over them\n * that fills the view around the host. Mounting or unmounting an overlay\n * renders the layer alone, so the screen under it keeps its state.\n *\n * The outermost `ThemeScope` renders one, so an app has one at its root.\n */\nfunction OverlayHost({ children }: { readonly children?: ReactNode }) {\n const [store] = useState(storeFor)\n\n return (\n <OverlayHostContext value={store}>\n {children}\n <OverlayLayer attach={store.attach} store={store} />\n </OverlayHostContext>\n )\n}\n\n// The layer passes a touch through to the screen wherever no overlay is\n// drawn, so an open overlay leaves the screen around it usable. It takes its\n// ref apart from the store, since the compiler reads an object a ref is taken\n// from as a ref itself, and the store is read during render.\nfunction OverlayLayer({\n attach,\n store,\n}: {\n readonly attach: OverlayStore['attach']\n readonly store: OverlayStore\n}) {\n const entries = useSyncExternalStore(store.subscribe, store.entries)\n\n return (\n <View ref={attach} style={styles.fill}>\n {entries.map(([key, content]) => (\n <View key={key} style={styles.fill}>\n {content}\n </View>\n ))}\n </View>\n )\n}\n\nfunction storeFor(): OverlayStore {\n const content = new Map<string, ReactNode>()\n const listeners = new Set<() => void>()\n let entries: readonly Entry[] = []\n let layer: ComponentRef<typeof View> | null = null\n\n const changed = () => {\n entries = [...content]\n for (const listener of listeners) {\n listener()\n }\n }\n\n return {\n attach: (view) => {\n layer = view\n },\n entries: () => entries,\n layer: () => layer,\n remove: (key) => {\n if (content.delete(key)) {\n changed()\n }\n },\n set: (key, node) => {\n content.set(key, node)\n changed()\n },\n subscribe: (listener) => {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n }\n}\n\nexport type { OverlayStore }\n\nexport { Overlay, OverlayHost, OverlayHostContext }\n"],"mappings":";;;;;;;AA6BA,MAAMyB,qBAAqBvB,cAAmC,IAAI;AAElE,MAAMwB,SAASlB,WAAWmB,OAAO,EAI/BC,MAAM;CACJC,QAAQ;CACRC,MAAM;CACNC,eAAe;CACfC,UAAU;CACVC,OAAO;CACPC,KAAK;AACP,EACF,CAAC;;;;;;;;;;;;;;AAeD,SAAAC,QAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAiB,MAAA,EAAAC,aAAAH;CACf,MAAAI,QAAcrC,IAAIsB,kBAAkB;CACpC,MAAAgB,QAAc5B,SAAS;CACvB,MAAA6B,SAAe/B,kBAAkB;CACjC,MAAAI,MAAYX,MAAM;CAElB,IAAIoC,UAAU,MACZ,MAAM,IAAIG,MACR,qIACF;CACD,IAAAC;CAAA,IAAAC;CAAA,IAAAR,EAAA,OAAAE,YAAAF,EAAA,OAAAtB,OAAAsB,EAAA,OAAAK,UAAAL,EAAA,OAAAI,SAAAJ,EAAA,OAAAG,OAAA;EAIeI,WAAA;GACdJ,MAAKlB,IACHP,KACA,oBAAC,cAAD;IAAqB0B,OAAAA;IACnB,UAAA,oBAAC,cAAD;KAAsBC;KAASH;IAAlB,CAAA;GADF,CAAA,CAGf;EAAC;EACAM,KAAA;GAACN;GAAUxB;GAA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ACrBH,QAAQ;EACV;EACAjC,YAAYC,aAAa;GACvB8B,UAAUM,IAAIpC,QAAQ;GACtB,aAAa;IACX8B,UAAUI,OAAOlC,QAAQ;GAC3B;EACF;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanso-labs/react-native-kanso-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"author": "Kanso Labs <kanso.labs.org@gmail.com>",
|
|
51
51
|
"dependencies": {
|
|
52
|
+
"@internationalized/date": "3.12.4",
|
|
52
53
|
"@internationalized/number": "3.6.9",
|
|
53
54
|
"react-stately": "3.51.0"
|
|
54
55
|
},
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
"@eslint/js": "10.0.1",
|
|
63
64
|
"@jest/globals": "29.7.0",
|
|
64
65
|
"@kanso-labs/kanso-ui": "0.43.6",
|
|
65
|
-
"@kanso-labs/unplugin-style-dictionary": "0.10.
|
|
66
|
+
"@kanso-labs/unplugin-style-dictionary": "0.10.34",
|
|
66
67
|
"@react-native/babel-preset": "0.88.0",
|
|
67
68
|
"@react-native/jest-preset": "0.88.0",
|
|
68
69
|
"@rolldown/plugin-babel": "0.2.4",
|