dash-ui-kit 2.0.0-dev → 2.1.0-dev
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/dist/react/components/badge/index.cjs.js +8 -3
- package/dist/react/components/badge/index.cjs.js.map +1 -1
- package/dist/react/components/badge/index.d.ts +10 -1
- package/dist/react/components/badge/index.esm.js +8 -3
- package/dist/react/components/badge/index.esm.js.map +1 -1
- package/dist/react/components/button/index.cjs.js +7 -2
- package/dist/react/components/button/index.cjs.js.map +1 -1
- package/dist/react/components/button/index.d.ts +4 -0
- package/dist/react/components/button/index.esm.js +7 -2
- package/dist/react/components/button/index.esm.js.map +1 -1
- package/dist/react/components/heading/index.cjs.js +7 -2
- package/dist/react/components/heading/index.cjs.js.map +1 -1
- package/dist/react/components/heading/index.d.ts +4 -1
- package/dist/react/components/heading/index.esm.js +7 -2
- package/dist/react/components/heading/index.esm.js.map +1 -1
- package/dist/react/components/input/index.cjs.js +7 -2
- package/dist/react/components/input/index.cjs.js.map +1 -1
- package/dist/react/components/input/index.d.ts +4 -0
- package/dist/react/components/input/index.esm.js +7 -2
- package/dist/react/components/input/index.esm.js.map +1 -1
- package/dist/react/components/overlayMenu/index.cjs.js +69 -25
- package/dist/react/components/overlayMenu/index.cjs.js.map +1 -1
- package/dist/react/components/overlayMenu/index.d.ts +9 -10
- package/dist/react/components/overlayMenu/index.esm.js +69 -25
- package/dist/react/components/overlayMenu/index.esm.js.map +1 -1
- package/dist/react/components/overlaySelect/index.cjs.js +7 -2
- package/dist/react/components/overlaySelect/index.cjs.js.map +1 -1
- package/dist/react/components/overlaySelect/index.d.ts +4 -0
- package/dist/react/components/overlaySelect/index.esm.js +7 -2
- package/dist/react/components/overlaySelect/index.esm.js.map +1 -1
- package/dist/react/components/progressStepBar/index.cjs.js +7 -2
- package/dist/react/components/progressStepBar/index.cjs.js.map +1 -1
- package/dist/react/components/progressStepBar/index.d.ts +5 -2
- package/dist/react/components/progressStepBar/index.esm.js +7 -2
- package/dist/react/components/progressStepBar/index.esm.js.map +1 -1
- package/dist/react/components/select/index.cjs.js +7 -2
- package/dist/react/components/select/index.cjs.js.map +1 -1
- package/dist/react/components/select/index.d.ts +4 -0
- package/dist/react/components/select/index.esm.js +7 -2
- package/dist/react/components/select/index.esm.js.map +1 -1
- package/dist/react/components/text/index.cjs.js +8 -2
- package/dist/react/components/text/index.cjs.js.map +1 -1
- package/dist/react/components/text/index.d.ts +5 -0
- package/dist/react/components/text/index.esm.js +8 -2
- package/dist/react/components/text/index.esm.js.map +1 -1
- package/dist/react/components/textarea/index.cjs.js +9 -5
- package/dist/react/components/textarea/index.cjs.js.map +1 -1
- package/dist/react/components/textarea/index.d.ts +4 -0
- package/dist/react/components/textarea/index.esm.js +9 -5
- package/dist/react/components/textarea/index.esm.js.map +1 -1
- package/dist/react/components/valueCard/index.cjs.js +7 -2
- package/dist/react/components/valueCard/index.cjs.js.map +1 -1
- package/dist/react/components/valueCard/index.d.ts +4 -0
- package/dist/react/components/valueCard/index.esm.js +7 -2
- package/dist/react/components/valueCard/index.esm.js.map +1 -1
- package/dist/react/hooks/index.d.ts +1 -0
- package/dist/react/hooks/useColorScheme.cjs.js +25 -0
- package/dist/react/hooks/useColorScheme.cjs.js.map +1 -0
- package/dist/react/hooks/useColorScheme.d.ts +9 -0
- package/dist/react/hooks/useColorScheme.esm.js +23 -0
- package/dist/react/hooks/useColorScheme.esm.js.map +1 -0
- package/dist/react-native/components/badge/index.d.ts +12 -0
- package/dist/react-native/components/button/index.d.ts +6 -0
- package/dist/react-native/components/input/index.d.ts +6 -0
- package/dist/react-native/components/valueCard/index.d.ts +4 -0
- package/dist/react-native/index.cjs.js +39 -13
- package/dist/react-native/index.cjs.js.map +1 -1
- package/dist/react-native/index.esm.js +39 -14
- package/dist/react-native/index.esm.js.map +1 -1
- package/dist/react-native/utils/index.d.ts +1 -0
- package/dist/react-native/utils/resolveColorScheme.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import { __rest } from 'tslib';
|
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
import { useTheme } from '../../contexts/ThemeContext.esm.js';
|
|
7
|
+
import { useColorScheme } from '../../hooks/useColorScheme.esm.js';
|
|
7
8
|
|
|
8
9
|
const valueCard = cva('flex items-center transition-all outline outline-1 outline-offset-[-1px]', {
|
|
9
10
|
variants: {
|
|
@@ -132,10 +133,13 @@ const valueCard = cva('flex items-center transition-all outline outline-1 outlin
|
|
|
132
133
|
* </ValueCard>
|
|
133
134
|
*/
|
|
134
135
|
const ValueCard = _a => {
|
|
136
|
+
var _b;
|
|
135
137
|
var {
|
|
136
138
|
as,
|
|
137
139
|
link = '',
|
|
138
140
|
colorScheme,
|
|
141
|
+
colorSchemeLight,
|
|
142
|
+
colorSchemeDark,
|
|
139
143
|
size,
|
|
140
144
|
clickable = false,
|
|
141
145
|
loading,
|
|
@@ -143,14 +147,15 @@ const ValueCard = _a => {
|
|
|
143
147
|
className = '',
|
|
144
148
|
children
|
|
145
149
|
} = _a,
|
|
146
|
-
props = __rest(_a, ["as", "link", "colorScheme", "size", "clickable", "loading", "border", "className", "children"]);
|
|
150
|
+
props = __rest(_a, ["as", "link", "colorScheme", "colorSchemeLight", "colorSchemeDark", "size", "clickable", "loading", "border", "className", "children"]);
|
|
147
151
|
const {
|
|
148
152
|
theme
|
|
149
153
|
} = useTheme();
|
|
154
|
+
const effectiveColorScheme = (_b = useColorScheme(colorScheme, colorSchemeLight, colorSchemeDark)) !== null && _b !== void 0 ? _b : 'default';
|
|
150
155
|
const isClickable = Boolean(link !== '' || clickable);
|
|
151
156
|
const classes = valueCard({
|
|
152
157
|
theme,
|
|
153
|
-
colorScheme,
|
|
158
|
+
colorScheme: effectiveColorScheme,
|
|
154
159
|
size,
|
|
155
160
|
clickable: isClickable,
|
|
156
161
|
loading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/react/components/valueCard/index.tsx"],"sourcesContent":["import React from 'react'\nimport { cva, VariantProps } from 'class-variance-authority'\nimport { useTheme } from '../../contexts/ThemeContext'\n\nconst valueCard = cva(\n 'flex items-center transition-all outline outline-1 outline-offset-[-1px]',\n {\n variants: {\n theme: {\n light: 'outline-gray-200',\n dark: 'bg-gray-800/50 outline-gray-400'\n },\n colorScheme: {\n default: '',\n transparent: 'bg-transparent',\n green: 'text-green-500 bg-green-200 outline-green-400',\n lightBlue: 'bg-dash-brand-dim/10 !outline-dash-brand/20',\n white: 'bg-white',\n lightGray: 'bg-dash-primary-die-subdued',\n yellow: 'bg-dash-yellow-light !outline-dash-yellow'\n },\n size: {\n xs: 'px-[0.5rem] py-[0.25rem] rounded-[0.25rem]',\n sm: 'dash-block-sm',\n md: 'dash-block-md',\n xl: 'dash-block-xl'\n },\n clickable: {\n false: '',\n true: 'cursor-pointer transition-colors active:translate-y-px active:opacity-90'\n },\n loading: {\n false: '',\n true: 'animate-pulse'\n },\n border: {\n false: '!outline-none',\n true: ''\n }\n },\n compoundVariants: [\n // default scheme hover\n { theme: 'light', colorScheme: 'default', clickable: true, class: 'hover:bg-gray-200/50' },\n { theme: 'dark', colorScheme: 'default', clickable: true, class: 'hover:bg-gray-700/50' },\n // transparent scheme hover\n { theme: 'light', colorScheme: 'transparent', clickable: true, class: 'hover:bg-gray-100' },\n { theme: 'dark', colorScheme: 'transparent', clickable: true, class: 'hover:bg-gray-900' },\n // green scheme hover\n { theme: 'light', colorScheme: 'green', clickable: true, class: 'hover:bg-green-300' },\n { theme: 'dark', colorScheme: 'green', clickable: true, class: 'hover:bg-green-400' },\n // green lightBlue\n { colorScheme: 'lightBlue', clickable: true, class: 'hover:bg-dash-brand/15' },\n // white\n { theme: 'light', colorScheme: 'white', clickable: true, class: 'hover:bg-gray-100' },\n { theme: 'dark', colorScheme: 'white', clickable: true, class: 'hover:bg-gray-100' },\n // lightGray scheme hover\n { theme: 'light', colorScheme: 'lightGray', clickable: true, class: 'hover:bg-dash-primary-die' },\n { theme: 'dark', colorScheme: 'lightGray', clickable: true, class: 'hover:bg-gray-600' },\n // yellow scheme hover\n { colorScheme: 'yellow', clickable: true, class: 'hover:bg-dash-yellow' }\n ],\n defaultVariants: {\n theme: 'light',\n colorScheme: 'default',\n size: 'md',\n clickable: false,\n loading: false,\n border: true\n }\n }\n)\n\ntype ValueCardVariants = VariantProps<typeof valueCard>\n\nexport interface ValueCardProps extends Omit<ValueCardVariants, 'theme'> {\n /** If you pass an `as` component, it'll receive `href` when `link` is set */\n as?: React.ElementType\n /** Only applies `href` if `as` is `'a'` or a component that accepts `href` */\n link?: string\n className?: string\n children: React.ReactNode\n /** Additional props to pass to the underlying element */\n [key: string]: any\n}\n\n/**\n * A card container that adapts to light/dark theme,\n * supports various color schemes, sizes, clickability,\n * loading state, and optional border styling.\n *\n * @example\n * <ValueCard colorScheme=\"green\" border as={Link} link=\"/foo\">\n * Go\n * </ValueCard>\n */\nexport const ValueCard: React.FC<ValueCardProps> = ({\n as,\n link = '',\n colorScheme,\n size,\n clickable = false,\n loading,\n border,\n className = '',\n children,\n ...props\n}) => {\n const { theme } = useTheme()\n const isClickable = Boolean(link !== '' || clickable)\n\n const classes = valueCard({\n theme,\n colorScheme,\n size,\n clickable: isClickable,\n loading,\n border\n }) + ' ' + (String(className))\n\n // choose element: custom `as`, or <a> if link, else <div>\n const Component = as ?? (link !== '' ? 'a' : 'div')\n\n const mergedProps: any = { ...props, className: classes }\n if (link !== '') mergedProps.href = link\n\n return <Component {...mergedProps}>{children}</Component>\n}\n\nexport default ValueCard "],"names":["valueCard","cva","variants","theme","light","dark","colorScheme","default","transparent","green","lightBlue","white","lightGray","yellow","size","xs","sm","md","xl","clickable","false","true","loading","border","compoundVariants","class","defaultVariants","ValueCard","_a","as","link","className","children","props","__rest","useTheme","isClickable","Boolean","classes","String","Component","mergedProps","href","_jsx","Object","assign"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/react/components/valueCard/index.tsx"],"sourcesContent":["import React from 'react'\nimport { cva, VariantProps } from 'class-variance-authority'\nimport { useTheme } from '../../contexts/ThemeContext'\nimport { useColorScheme } from '../../hooks/useColorScheme'\n\nconst valueCard = cva(\n 'flex items-center transition-all outline outline-1 outline-offset-[-1px]',\n {\n variants: {\n theme: {\n light: 'outline-gray-200',\n dark: 'bg-gray-800/50 outline-gray-400'\n },\n colorScheme: {\n default: '',\n transparent: 'bg-transparent',\n green: 'text-green-500 bg-green-200 outline-green-400',\n lightBlue: 'bg-dash-brand-dim/10 !outline-dash-brand/20',\n white: 'bg-white',\n lightGray: 'bg-dash-primary-die-subdued',\n yellow: 'bg-dash-yellow-light !outline-dash-yellow'\n },\n size: {\n xs: 'px-[0.5rem] py-[0.25rem] rounded-[0.25rem]',\n sm: 'dash-block-sm',\n md: 'dash-block-md',\n xl: 'dash-block-xl'\n },\n clickable: {\n false: '',\n true: 'cursor-pointer transition-colors active:translate-y-px active:opacity-90'\n },\n loading: {\n false: '',\n true: 'animate-pulse'\n },\n border: {\n false: '!outline-none',\n true: ''\n }\n },\n compoundVariants: [\n // default scheme hover\n { theme: 'light', colorScheme: 'default', clickable: true, class: 'hover:bg-gray-200/50' },\n { theme: 'dark', colorScheme: 'default', clickable: true, class: 'hover:bg-gray-700/50' },\n // transparent scheme hover\n { theme: 'light', colorScheme: 'transparent', clickable: true, class: 'hover:bg-gray-100' },\n { theme: 'dark', colorScheme: 'transparent', clickable: true, class: 'hover:bg-gray-900' },\n // green scheme hover\n { theme: 'light', colorScheme: 'green', clickable: true, class: 'hover:bg-green-300' },\n { theme: 'dark', colorScheme: 'green', clickable: true, class: 'hover:bg-green-400' },\n // green lightBlue\n { colorScheme: 'lightBlue', clickable: true, class: 'hover:bg-dash-brand/15' },\n // white\n { theme: 'light', colorScheme: 'white', clickable: true, class: 'hover:bg-gray-100' },\n { theme: 'dark', colorScheme: 'white', clickable: true, class: 'hover:bg-gray-100' },\n // lightGray scheme hover\n { theme: 'light', colorScheme: 'lightGray', clickable: true, class: 'hover:bg-dash-primary-die' },\n { theme: 'dark', colorScheme: 'lightGray', clickable: true, class: 'hover:bg-gray-600' },\n // yellow scheme hover\n { colorScheme: 'yellow', clickable: true, class: 'hover:bg-dash-yellow' }\n ],\n defaultVariants: {\n theme: 'light',\n colorScheme: 'default',\n size: 'md',\n clickable: false,\n loading: false,\n border: true\n }\n }\n)\n\ntype ValueCardVariants = VariantProps<typeof valueCard>\n\nexport interface ValueCardProps extends Omit<ValueCardVariants, 'theme'> {\n /** If you pass an `as` component, it'll receive `href` when `link` is set */\n as?: React.ElementType\n /** Only applies `href` if `as` is `'a'` or a component that accepts `href` */\n link?: string\n className?: string\n children: React.ReactNode\n /** Color scheme override for light theme */\n colorSchemeLight?: 'default' | 'transparent' | 'green' | 'lightBlue' | 'white' | 'lightGray' | 'yellow'\n /** Color scheme override for dark theme */\n colorSchemeDark?: 'default' | 'transparent' | 'green' | 'lightBlue' | 'white' | 'lightGray' | 'yellow'\n /** Additional props to pass to the underlying element */\n [key: string]: any\n}\n\n/**\n * A card container that adapts to light/dark theme,\n * supports various color schemes, sizes, clickability,\n * loading state, and optional border styling.\n *\n * @example\n * <ValueCard colorScheme=\"green\" border as={Link} link=\"/foo\">\n * Go\n * </ValueCard>\n */\nexport const ValueCard: React.FC<ValueCardProps> = ({\n as,\n link = '',\n colorScheme,\n colorSchemeLight,\n colorSchemeDark,\n size,\n clickable = false,\n loading,\n border,\n className = '',\n children,\n ...props\n}) => {\n const { theme } = useTheme()\n const effectiveColorScheme = useColorScheme(colorScheme, colorSchemeLight, colorSchemeDark) ?? 'default'\n const isClickable = Boolean(link !== '' || clickable)\n\n const classes = valueCard({\n theme,\n colorScheme: effectiveColorScheme,\n size,\n clickable: isClickable,\n loading,\n border\n }) + ' ' + (String(className))\n\n // choose element: custom `as`, or <a> if link, else <div>\n const Component = as ?? (link !== '' ? 'a' : 'div')\n\n const mergedProps: any = { ...props, className: classes }\n if (link !== '') mergedProps.href = link\n\n return <Component {...mergedProps}>{children}</Component>\n}\n\nexport default ValueCard "],"names":["valueCard","cva","variants","theme","light","dark","colorScheme","default","transparent","green","lightBlue","white","lightGray","yellow","size","xs","sm","md","xl","clickable","false","true","loading","border","compoundVariants","class","defaultVariants","ValueCard","_a","as","link","colorSchemeLight","colorSchemeDark","className","children","props","__rest","useTheme","effectiveColorScheme","_b","useColorScheme","isClickable","Boolean","classes","String","Component","mergedProps","href","_jsx","Object","assign"],"mappings":";;;;;;;;AAKA,MAAMA,SAAS,GAAGC,GAAG,CACnB,0EAA0E,EAC1E;AACEC,EAAAA,QAAQ,EAAE;AACRC,IAAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAE,kBAAkB;AACzBC,MAAAA,IAAI,EAAE;KACP;AACDC,IAAAA,WAAW,EAAE;AACXC,MAAAA,OAAO,EAAE,EAAE;AACXC,MAAAA,WAAW,EAAE,gBAAgB;AAC7BC,MAAAA,KAAK,EAAE,+CAA+C;AACtDC,MAAAA,SAAS,EAAE,6CAA6C;AACxDC,MAAAA,KAAK,EAAE,UAAU;AACjBC,MAAAA,SAAS,EAAE,6BAA6B;AACxCC,MAAAA,MAAM,EAAE;KACT;AACDC,IAAAA,IAAI,EAAE;AACJC,MAAAA,EAAE,EAAE,4CAA4C;AAChDC,MAAAA,EAAE,EAAE,eAAe;AACnBC,MAAAA,EAAE,EAAE,eAAe;AACnBC,MAAAA,EAAE,EAAE;KACL;AACDC,IAAAA,SAAS,EAAE;AACTC,MAAAA,KAAK,EAAE,EAAE;AACTC,MAAAA,IAAI,EAAE;KACP;AACDC,IAAAA,OAAO,EAAE;AACPF,MAAAA,KAAK,EAAE,EAAE;AACTC,MAAAA,IAAI,EAAE;KACP;AACDE,IAAAA,MAAM,EAAE;AACNH,MAAAA,KAAK,EAAE,eAAe;AACtBC,MAAAA,IAAI,EAAE;AACP;GACF;AACDG,EAAAA,gBAAgB,EAAE;AAChB;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CAAC,MAAA,IAAA,IAAAO,EAAA,KAAA,MAAA,GAAAA,EAAA,GAAI,SAAS;EACxG,MAAME,WAAW,GAAGC,OAAO,CAACZ,IAAI,KAAK,EAAE,IAAIX,SAAS,CAAC;EAErD,MAAMwB,OAAO,GAAG3C,SAAS,CAAC;IACxBG,KAAK;AACLG,IAAAA,WAAW,EAAEgC,oBAAoB;IACjCxB,IAAI;AACJK,IAAAA,SAAS,EAAEsB,WAAW;IACtBnB,OAAO;AACPC,IAAAA;GACD,CAAC,GAAG,GAAG,GAAIqB,MAAM,CAACX,SAAS,CAAE;AAE9B;AACA,EAAA,MAAMY,SAAS,GAAGhB,EAAE,KAAA,IAAA,IAAFA,EAAE,KAAF,MAAA,GAAAA,EAAE,GAAKC,IAAI,KAAK,EAAE,GAAG,GAAG,GAAG,KAAM;AAEnD,EAAA,MAAMgB,WAAW,mCAAaX,KAAK,CAAA,EAAA;AAAEF,IAAAA,SAAS,EAAEU;IAAS;EACzD,IAAIb,IAAI,KAAK,EAAE,EAAEgB,WAAW,CAACC,IAAI,GAAGjB,IAAI;AAExC,EAAA,OAAOkB,IAACH,SAAS,EAAAI,MAAA,CAAAC,MAAA,CAAA,EAAA,EAAKJ,WAAW,EAAG;AAAAZ,IAAAA,QAAA,EAAAA;KAAqB;AAC3D;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var ThemeContext = require('../contexts/ThemeContext.cjs.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Resolves the effective color scheme based on the active theme.
|
|
9
|
+
*
|
|
10
|
+
* Priority:
|
|
11
|
+
* 1. colorSchemeLight — when theme is 'light' and value is provided
|
|
12
|
+
* 2. colorSchemeDark — when theme is 'dark' and value is provided
|
|
13
|
+
* 3. colorScheme — fallback, theme-independent
|
|
14
|
+
*/
|
|
15
|
+
function useColorScheme(colorScheme, colorSchemeLight, colorSchemeDark) {
|
|
16
|
+
const {
|
|
17
|
+
theme
|
|
18
|
+
} = ThemeContext.useTheme();
|
|
19
|
+
if (theme === 'light' && colorSchemeLight !== undefined) return colorSchemeLight;
|
|
20
|
+
if (theme === 'dark' && colorSchemeDark !== undefined) return colorSchemeDark;
|
|
21
|
+
return colorScheme;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.useColorScheme = useColorScheme;
|
|
25
|
+
//# sourceMappingURL=useColorScheme.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColorScheme.cjs.js","sources":["../../../src/react/hooks/useColorScheme.ts"],"sourcesContent":["import { useTheme } from '../contexts/ThemeContext'\n\n/**\n * Resolves the effective color scheme based on the active theme.\n *\n * Priority:\n * 1. colorSchemeLight — when theme is 'light' and value is provided\n * 2. colorSchemeDark — when theme is 'dark' and value is provided\n * 3. colorScheme — fallback, theme-independent\n */\nexport function useColorScheme<T>(\n colorScheme?: T,\n colorSchemeLight?: T,\n colorSchemeDark?: T\n): T | undefined {\n const { theme } = useTheme()\n\n if (theme === 'light' && colorSchemeLight !== undefined) return colorSchemeLight\n if (theme === 'dark' && colorSchemeDark !== undefined) return colorSchemeDark\n\n return colorScheme\n}\n"],"names":["useColorScheme","colorScheme","colorSchemeLight","colorSchemeDark","theme","useTheme","undefined"],"mappings":";;;;;;AAEA;;;;;;;AAOG;SACaA,cAAcA,CAC5BC,WAAe,EACfC,gBAAoB,EACpBC,eAAmB,EAAA;EAEnB,MAAM;AAAEC,IAAAA;GAAO,GAAGC,qBAAQ,EAAE;EAE5B,IAAID,KAAK,KAAK,OAAO,IAAIF,gBAAgB,KAAKI,SAAS,EAAE,OAAOJ,gBAAgB;EAChF,IAAIE,KAAK,KAAK,MAAM,IAAID,eAAe,KAAKG,SAAS,EAAE,OAAOH,eAAe;AAE7E,EAAA,OAAOF,WAAW;AACpB;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the effective color scheme based on the active theme.
|
|
3
|
+
*
|
|
4
|
+
* Priority:
|
|
5
|
+
* 1. colorSchemeLight — when theme is 'light' and value is provided
|
|
6
|
+
* 2. colorSchemeDark — when theme is 'dark' and value is provided
|
|
7
|
+
* 3. colorScheme — fallback, theme-independent
|
|
8
|
+
*/
|
|
9
|
+
export declare function useColorScheme<T>(colorScheme?: T, colorSchemeLight?: T, colorSchemeDark?: T): T | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useTheme } from '../contexts/ThemeContext.esm.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the effective color scheme based on the active theme.
|
|
7
|
+
*
|
|
8
|
+
* Priority:
|
|
9
|
+
* 1. colorSchemeLight — when theme is 'light' and value is provided
|
|
10
|
+
* 2. colorSchemeDark — when theme is 'dark' and value is provided
|
|
11
|
+
* 3. colorScheme — fallback, theme-independent
|
|
12
|
+
*/
|
|
13
|
+
function useColorScheme(colorScheme, colorSchemeLight, colorSchemeDark) {
|
|
14
|
+
const {
|
|
15
|
+
theme
|
|
16
|
+
} = useTheme();
|
|
17
|
+
if (theme === 'light' && colorSchemeLight !== undefined) return colorSchemeLight;
|
|
18
|
+
if (theme === 'dark' && colorSchemeDark !== undefined) return colorSchemeDark;
|
|
19
|
+
return colorScheme;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { useColorScheme };
|
|
23
|
+
//# sourceMappingURL=useColorScheme.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColorScheme.esm.js","sources":["../../../src/react/hooks/useColorScheme.ts"],"sourcesContent":["import { useTheme } from '../contexts/ThemeContext'\n\n/**\n * Resolves the effective color scheme based on the active theme.\n *\n * Priority:\n * 1. colorSchemeLight — when theme is 'light' and value is provided\n * 2. colorSchemeDark — when theme is 'dark' and value is provided\n * 3. colorScheme — fallback, theme-independent\n */\nexport function useColorScheme<T>(\n colorScheme?: T,\n colorSchemeLight?: T,\n colorSchemeDark?: T\n): T | undefined {\n const { theme } = useTheme()\n\n if (theme === 'light' && colorSchemeLight !== undefined) return colorSchemeLight\n if (theme === 'dark' && colorSchemeDark !== undefined) return colorSchemeDark\n\n return colorScheme\n}\n"],"names":["useColorScheme","colorScheme","colorSchemeLight","colorSchemeDark","theme","useTheme","undefined"],"mappings":";;;;AAEA;;;;;;;AAOG;SACaA,cAAcA,CAC5BC,WAAe,EACfC,gBAAoB,EACpBC,eAAmB,EAAA;EAEnB,MAAM;AAAEC,IAAAA;GAAO,GAAGC,QAAQ,EAAE;EAE5B,IAAID,KAAK,KAAK,OAAO,IAAIF,gBAAgB,KAAKI,SAAS,EAAE,OAAOJ,gBAAgB;EAChF,IAAIE,KAAK,KAAK,MAAM,IAAID,eAAe,KAAKG,SAAS,EAAE,OAAOH,eAAe;AAE7E,EAAA,OAAOF,WAAW;AACpB;;;;"}
|
|
@@ -16,6 +16,18 @@ export interface BadgeProps extends Omit<PressableProps, 'style'> {
|
|
|
16
16
|
* Color theme
|
|
17
17
|
*/
|
|
18
18
|
color?: 'blue' | 'white' | 'gray' | 'light-gray' | 'turquoise' | 'red' | 'orange';
|
|
19
|
+
/**
|
|
20
|
+
* Light or dark theme
|
|
21
|
+
*/
|
|
22
|
+
theme?: 'light' | 'dark';
|
|
23
|
+
/**
|
|
24
|
+
* Color override for light theme
|
|
25
|
+
*/
|
|
26
|
+
colorLight?: 'blue' | 'white' | 'gray' | 'light-gray' | 'turquoise' | 'red' | 'orange';
|
|
27
|
+
/**
|
|
28
|
+
* Color override for dark theme
|
|
29
|
+
*/
|
|
30
|
+
colorDark?: 'blue' | 'white' | 'gray' | 'light-gray' | 'turquoise' | 'red' | 'orange';
|
|
19
31
|
/**
|
|
20
32
|
* Size of the badge
|
|
21
33
|
*/
|
|
@@ -10,10 +10,16 @@ declare const buttonStyles: (props?: ({
|
|
|
10
10
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
11
11
|
type ButtonVariants = Omit<VariantProps<typeof buttonStyles>, 'disabled'>;
|
|
12
12
|
export interface ButtonProps extends Omit<PressableProps, 'style'>, ButtonVariants {
|
|
13
|
+
/** Light or dark theme */
|
|
14
|
+
theme?: 'light' | 'dark';
|
|
13
15
|
/** Solid, outline, or ghost style */
|
|
14
16
|
variant?: 'solid' | 'outline' | 'ghost';
|
|
15
17
|
/** Color scheme for the button */
|
|
16
18
|
colorScheme?: 'brand' | 'mint' | 'gray' | 'red' | 'lightBlue' | 'lightGray' | 'white' | 'halfWhite' | 'halfBlue';
|
|
19
|
+
/** Color scheme override for light theme */
|
|
20
|
+
colorSchemeLight?: 'brand' | 'mint' | 'gray' | 'red' | 'lightBlue' | 'lightGray' | 'white' | 'halfWhite' | 'halfBlue';
|
|
21
|
+
/** Color scheme override for dark theme */
|
|
22
|
+
colorSchemeDark?: 'brand' | 'mint' | 'gray' | 'red' | 'lightBlue' | 'lightGray' | 'white' | 'halfWhite' | 'halfBlue';
|
|
17
23
|
/** Size of the button */
|
|
18
24
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
19
25
|
/** Border radius style */
|
|
@@ -9,6 +9,12 @@ declare const inputStyles: (props?: ({
|
|
|
9
9
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
10
|
type InputVariants = VariantProps<typeof inputStyles>;
|
|
11
11
|
export interface InputProps extends Omit<TextInputProps, 'editable'>, Omit<InputVariants, 'disabled'> {
|
|
12
|
+
/** Light or dark theme */
|
|
13
|
+
theme?: 'light' | 'dark';
|
|
14
|
+
/** Color scheme override for light theme */
|
|
15
|
+
colorSchemeLight?: 'default' | 'brand' | 'error' | 'success' | 'light-gray';
|
|
16
|
+
/** Color scheme override for dark theme */
|
|
17
|
+
colorSchemeDark?: 'default' | 'brand' | 'error' | 'success' | 'light-gray';
|
|
12
18
|
className?: string;
|
|
13
19
|
error?: boolean;
|
|
14
20
|
success?: boolean;
|
|
@@ -20,6 +20,10 @@ export interface ValueCardProps extends Omit<PressableProps, 'style'>, Omit<Valu
|
|
|
20
20
|
theme?: 'light' | 'dark';
|
|
21
21
|
/** Color scheme */
|
|
22
22
|
colorScheme?: 'default' | 'transparent' | 'green' | 'lightBlue' | 'white' | 'lightGray' | 'yellow';
|
|
23
|
+
/** Color scheme override for light theme */
|
|
24
|
+
colorSchemeLight?: 'default' | 'transparent' | 'green' | 'lightBlue' | 'white' | 'lightGray' | 'yellow';
|
|
25
|
+
/** Color scheme override for dark theme */
|
|
26
|
+
colorSchemeDark?: 'default' | 'transparent' | 'green' | 'lightBlue' | 'white' | 'lightGray' | 'yellow';
|
|
23
27
|
/** Size variant */
|
|
24
28
|
size?: 'xs' | 'sm' | 'md' | 'xl';
|
|
25
29
|
/** Whether the card is clickable (shows press feedback) */
|
|
@@ -209,6 +209,12 @@ const Heading = _a => {
|
|
|
209
209
|
}));
|
|
210
210
|
};
|
|
211
211
|
|
|
212
|
+
function resolveColorScheme(theme, colorScheme, colorSchemeLight, colorSchemeDark) {
|
|
213
|
+
if (theme === 'light' && colorSchemeLight !== undefined) return colorSchemeLight;
|
|
214
|
+
if (theme === 'dark' && colorSchemeDark !== undefined) return colorSchemeDark;
|
|
215
|
+
return colorScheme;
|
|
216
|
+
}
|
|
217
|
+
|
|
212
218
|
const buttonStyles = classVarianceAuthority.cva('items-center justify-center flex-row min-h-11 transition-colors border border-transparent', {
|
|
213
219
|
variants: {
|
|
214
220
|
variant: {
|
|
@@ -460,9 +466,13 @@ const textStyles$1 = classVarianceAuthority.cva('font-medium', {
|
|
|
460
466
|
* Uses Pressable for touch interactions and twrnc for Tailwind styling.
|
|
461
467
|
*/
|
|
462
468
|
const Button = _a => {
|
|
469
|
+
var _b;
|
|
463
470
|
var {
|
|
471
|
+
theme = 'light',
|
|
464
472
|
variant,
|
|
465
473
|
colorScheme,
|
|
474
|
+
colorSchemeLight,
|
|
475
|
+
colorSchemeDark,
|
|
466
476
|
size,
|
|
467
477
|
rounded,
|
|
468
478
|
disabled = false,
|
|
@@ -473,18 +483,19 @@ const Button = _a => {
|
|
|
473
483
|
children,
|
|
474
484
|
onPress
|
|
475
485
|
} = _a,
|
|
476
|
-
props = tslib.__rest(_a, ["variant", "colorScheme", "size", "rounded", "disabled", "loading", "className", "style", "textStyle", "children", "onPress"]);
|
|
486
|
+
props = tslib.__rest(_a, ["theme", "variant", "colorScheme", "colorSchemeLight", "colorSchemeDark", "size", "rounded", "disabled", "loading", "className", "style", "textStyle", "children", "onPress"]);
|
|
477
487
|
const isDisabled = disabled || loading;
|
|
488
|
+
const effectiveColorScheme = (_b = resolveColorScheme(theme, colorScheme, colorSchemeLight, colorSchemeDark)) !== null && _b !== void 0 ? _b : 'brand';
|
|
478
489
|
const buttonClasses = buttonStyles({
|
|
479
490
|
variant,
|
|
480
|
-
colorScheme,
|
|
491
|
+
colorScheme: effectiveColorScheme,
|
|
481
492
|
size,
|
|
482
493
|
rounded,
|
|
483
494
|
disabled: isDisabled
|
|
484
495
|
}) + (className ? ` ${className}` : '');
|
|
485
496
|
const textClasses = textStyles$1({
|
|
486
497
|
variant,
|
|
487
|
-
colorScheme,
|
|
498
|
+
colorScheme: effectiveColorScheme,
|
|
488
499
|
size
|
|
489
500
|
});
|
|
490
501
|
// Convert Tailwind classes to React Native style objects
|
|
@@ -501,7 +512,7 @@ const Button = _a => {
|
|
|
501
512
|
}, props, {
|
|
502
513
|
children: loading ? jsxRuntime.jsx(reactNative.ActivityIndicator, {
|
|
503
514
|
size: "small",
|
|
504
|
-
color: variant === 'solid' &&
|
|
515
|
+
color: variant === 'solid' && effectiveColorScheme === 'brand' ? '#fff' : '#3B82F6'
|
|
505
516
|
}) : typeof children === 'string' ? jsxRuntime.jsx(reactNative.Text, {
|
|
506
517
|
style: textStyleMerged,
|
|
507
518
|
children: children
|
|
@@ -1017,9 +1028,13 @@ const inputStyles = classVarianceAuthority.cva('w-full font-normal text-sm leadi
|
|
|
1017
1028
|
* />
|
|
1018
1029
|
*/
|
|
1019
1030
|
const Input = _a => {
|
|
1031
|
+
var _b;
|
|
1020
1032
|
var {
|
|
1033
|
+
theme = 'light',
|
|
1021
1034
|
className = '',
|
|
1022
1035
|
colorScheme,
|
|
1036
|
+
colorSchemeLight,
|
|
1037
|
+
colorSchemeDark,
|
|
1023
1038
|
size,
|
|
1024
1039
|
variant,
|
|
1025
1040
|
error = false,
|
|
@@ -1032,10 +1047,11 @@ const Input = _a => {
|
|
|
1032
1047
|
style,
|
|
1033
1048
|
textStyle
|
|
1034
1049
|
} = _a,
|
|
1035
|
-
props = tslib.__rest(_a, ["className", "colorScheme", "size", "variant", "error", "success", "disabled", "secureTextEntry", "prefix", "prefixStyle", "showPasswordToggle", "style", "textStyle"]);
|
|
1050
|
+
props = tslib.__rest(_a, ["theme", "className", "colorScheme", "colorSchemeLight", "colorSchemeDark", "size", "variant", "error", "success", "disabled", "secureTextEntry", "prefix", "prefixStyle", "showPasswordToggle", "style", "textStyle"]);
|
|
1036
1051
|
const [showPassword, setShowPassword] = react.useState(false);
|
|
1037
1052
|
// Determine color scheme based on state
|
|
1038
|
-
|
|
1053
|
+
const effectiveColorScheme = (_b = resolveColorScheme(theme, colorScheme, colorSchemeLight, colorSchemeDark)) !== null && _b !== void 0 ? _b : 'default';
|
|
1054
|
+
let finalColorScheme = effectiveColorScheme;
|
|
1039
1055
|
if (error) finalColorScheme = 'error';else if (success) finalColorScheme = 'success';
|
|
1040
1056
|
const classes = inputStyles({
|
|
1041
1057
|
colorScheme: finalColorScheme,
|
|
@@ -1595,10 +1611,14 @@ const COLOR_KEY_MAP = {
|
|
|
1595
1611
|
* Supports 28 style combinations (7 colors × 4 variants) with 4 sizes and optional custom border radius.
|
|
1596
1612
|
*/
|
|
1597
1613
|
const Badge = _a => {
|
|
1614
|
+
var _b;
|
|
1598
1615
|
var {
|
|
1599
1616
|
children,
|
|
1617
|
+
theme = 'light',
|
|
1600
1618
|
variant = 'default',
|
|
1601
|
-
color
|
|
1619
|
+
color,
|
|
1620
|
+
colorLight,
|
|
1621
|
+
colorDark,
|
|
1602
1622
|
size = 'sm',
|
|
1603
1623
|
borderRadius,
|
|
1604
1624
|
className = '',
|
|
@@ -1606,9 +1626,10 @@ const Badge = _a => {
|
|
|
1606
1626
|
textStyle,
|
|
1607
1627
|
onPress
|
|
1608
1628
|
} = _a,
|
|
1609
|
-
props = tslib.__rest(_a, ["children", "variant", "color", "size", "borderRadius", "className", "style", "textStyle", "onPress"]);
|
|
1629
|
+
props = tslib.__rest(_a, ["children", "theme", "variant", "color", "colorLight", "colorDark", "size", "borderRadius", "className", "style", "textStyle", "onPress"]);
|
|
1630
|
+
const effectiveColor = (_b = resolveColorScheme(theme, color, colorLight, colorDark)) !== null && _b !== void 0 ? _b : 'blue';
|
|
1610
1631
|
// Generate the color_variant key for CVA using explicit mapping
|
|
1611
|
-
const normalizedColor = COLOR_KEY_MAP[
|
|
1632
|
+
const normalizedColor = COLOR_KEY_MAP[effectiveColor] || effectiveColor;
|
|
1612
1633
|
const colorVariantKey = `color_variant_${normalizedColor}_${variant}`;
|
|
1613
1634
|
// Build the badge container classes with proper typing
|
|
1614
1635
|
const badgeVariantProps = {
|
|
@@ -2198,9 +2219,12 @@ const valueCardStyles = classVarianceAuthority.cva('flex flex-row items-center',
|
|
|
2198
2219
|
* clickability, loading state, and optional border.
|
|
2199
2220
|
*/
|
|
2200
2221
|
const ValueCard = _a => {
|
|
2222
|
+
var _b;
|
|
2201
2223
|
var {
|
|
2202
2224
|
theme = 'light',
|
|
2203
|
-
colorScheme
|
|
2225
|
+
colorScheme,
|
|
2226
|
+
colorSchemeLight,
|
|
2227
|
+
colorSchemeDark,
|
|
2204
2228
|
size = 'md',
|
|
2205
2229
|
clickable = false,
|
|
2206
2230
|
loading = false,
|
|
@@ -2210,12 +2234,13 @@ const ValueCard = _a => {
|
|
|
2210
2234
|
children,
|
|
2211
2235
|
onPress
|
|
2212
2236
|
} = _a,
|
|
2213
|
-
props = tslib.__rest(_a, ["theme", "colorScheme", "size", "clickable", "loading", "border", "className", "style", "children", "onPress"]);
|
|
2237
|
+
props = tslib.__rest(_a, ["theme", "colorScheme", "colorSchemeLight", "colorSchemeDark", "size", "clickable", "loading", "border", "className", "style", "children", "onPress"]);
|
|
2214
2238
|
const isClickable = Boolean(onPress !== null && onPress !== void 0 ? onPress : clickable);
|
|
2215
2239
|
const isDisabled = loading;
|
|
2240
|
+
const effectiveColorScheme = (_b = resolveColorScheme(theme, colorScheme, colorSchemeLight, colorSchemeDark)) !== null && _b !== void 0 ? _b : 'default';
|
|
2216
2241
|
const classes = valueCardStyles({
|
|
2217
2242
|
theme,
|
|
2218
|
-
colorScheme,
|
|
2243
|
+
colorScheme: effectiveColorScheme,
|
|
2219
2244
|
size,
|
|
2220
2245
|
clickable: isClickable,
|
|
2221
2246
|
loading,
|
|
@@ -2226,7 +2251,7 @@ const ValueCard = _a => {
|
|
|
2226
2251
|
const content = loading ? jsxRuntime.jsx(reactNative.ActivityIndicator, {
|
|
2227
2252
|
testID: "value-card-loading",
|
|
2228
2253
|
size: "small",
|
|
2229
|
-
color:
|
|
2254
|
+
color: effectiveColorScheme === 'green' ? '#22c55e' : effectiveColorScheme === 'lightBlue' ? '#4C7EFF' : '#6B7280'
|
|
2230
2255
|
}) : children;
|
|
2231
2256
|
if (isClickable && !isDisabled) {
|
|
2232
2257
|
return jsxRuntime.jsx(reactNative.Pressable, Object.assign({
|
|
@@ -2846,6 +2871,7 @@ exports.colors = colors;
|
|
|
2846
2871
|
exports.getShadow = getShadow;
|
|
2847
2872
|
exports.hexToRgba = hexToRgba;
|
|
2848
2873
|
exports.opacity = opacity;
|
|
2874
|
+
exports.resolveColorScheme = resolveColorScheme;
|
|
2849
2875
|
exports.rgba = rgba;
|
|
2850
2876
|
exports.shadows = shadows;
|
|
2851
2877
|
exports.spacing = spacing;
|