@cdx-ui/components 0.0.1-alpha.26 → 0.0.1-alpha.28
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/lib/commonjs/components/Button/buttonSharedVariants.js +200 -0
- package/lib/commonjs/components/Button/buttonSharedVariants.js.map +1 -0
- package/lib/commonjs/components/Button/styles.js +21 -222
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/IconButton/index.js +80 -0
- package/lib/commonjs/components/IconButton/index.js.map +1 -0
- package/lib/commonjs/components/IconButton/styles.js +91 -0
- package/lib/commonjs/components/IconButton/styles.js.map +1 -0
- package/lib/commonjs/components/Image/Image.js +69 -0
- package/lib/commonjs/components/Image/Image.js.map +1 -0
- package/lib/commonjs/components/Image/index.js +13 -0
- package/lib/commonjs/components/Image/index.js.map +1 -0
- package/lib/commonjs/components/index.js +24 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/Button/buttonSharedVariants.js +195 -0
- package/lib/module/components/Button/buttonSharedVariants.js.map +1 -0
- package/lib/module/components/Button/styles.js +21 -223
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/IconButton/index.js +76 -0
- package/lib/module/components/IconButton/index.js.map +1 -0
- package/lib/module/components/IconButton/styles.js +87 -0
- package/lib/module/components/IconButton/styles.js.map +1 -0
- package/lib/module/components/Image/Image.js +67 -0
- package/lib/module/components/Image/Image.js.map +1 -0
- package/lib/module/components/Image/index.js +4 -0
- package/lib/module/components/Image/index.js.map +1 -0
- package/lib/module/components/index.js +2 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/components/Button/buttonSharedVariants.d.ts +29 -0
- package/lib/typescript/components/Button/buttonSharedVariants.d.ts.map +1 -0
- package/lib/typescript/components/Button/styles.d.ts +6 -6
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/index.d.ts +15 -0
- package/lib/typescript/components/IconButton/index.d.ts.map +1 -0
- package/lib/typescript/components/IconButton/styles.d.ts +16 -0
- package/lib/typescript/components/IconButton/styles.d.ts.map +1 -0
- package/lib/typescript/components/Image/Image.d.ts +47 -0
- package/lib/typescript/components/Image/Image.d.ts.map +1 -0
- package/lib/typescript/components/Image/index.d.ts +2 -0
- package/lib/typescript/components/Image/index.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/Button/buttonSharedVariants.ts +281 -0
- package/src/components/Button/styles.ts +32 -275
- package/src/components/IconButton/index.tsx +93 -0
- package/src/components/IconButton/styles.ts +131 -0
- package/src/components/Image/Image.tsx +77 -0
- package/src/components/Image/index.ts +1 -0
- package/src/components/index.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAwClE,eAAO,MAAM,kBAAkB;;;;;;8EAmL9B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;8EAiC7B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;8EAoFhC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;8EAiB9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;8EAU7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACzE,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { View, type PressableProps } from 'react-native';
|
|
2
|
+
import { type IButtonProps } from '@cdx-ui/primitives';
|
|
3
|
+
import type { CdxIcon } from '@cdx-ui/icons';
|
|
4
|
+
import { type IconProps } from '../Icon';
|
|
5
|
+
import { type IconButtonVariantProps } from './styles';
|
|
6
|
+
export interface IconButtonProps extends PressableProps, IButtonProps, IconButtonVariantProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
/** CDX icon component to render (icon-only control). */
|
|
9
|
+
as: CdxIcon;
|
|
10
|
+
/** Passed through to the underlying `Icon`. */
|
|
11
|
+
iconClassName?: IconProps['className'];
|
|
12
|
+
}
|
|
13
|
+
export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<View>>;
|
|
14
|
+
export type { IconButtonVariantProps };
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/IconButton/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsC,IAAI,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EACL,KAAK,sBAAsB,EAI5B,MAAM,UAAU,CAAC;AA2BlB,MAAM,WAAW,eAAgB,SAAQ,cAAc,EAAE,YAAY,EAAE,sBAAsB;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,EAAE,EAAE,OAAO,CAAC;IACZ,+CAA+C;IAC/C,aAAa,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACxC;AAyCD,eAAO,MAAM,UAAU,kGAAiB,CAAC;AAEzC,YAAY,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const iconButtonRootVariants: (props?: ({
|
|
3
|
+
variant?: "ghost" | "solid" | null | undefined;
|
|
4
|
+
size?: "small" | "default" | null | undefined;
|
|
5
|
+
mode?: "dark" | "light" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export declare const iconButtonGlyphVariants: (props?: ({
|
|
8
|
+
size?: "small" | "default" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
/** Icon fill aligned with Button outline/ghost action label colors (solid matches ghost). */
|
|
11
|
+
export declare const iconButtonIconColorVariants: (props?: ({
|
|
12
|
+
variant?: "ghost" | "solid" | null | undefined;
|
|
13
|
+
mode?: "dark" | "light" | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
export type IconButtonVariantProps = VariantProps<typeof iconButtonRootVariants>;
|
|
16
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/IconButton/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAyClE,eAAO,MAAM,sBAAsB;;;;8EAuDlC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;8EAUlC,CAAC;AAEH,6FAA6F;AAC7F,eAAO,MAAM,2BAA2B;;;8EAgBtC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin wrapper around React Native's `Image`.
|
|
3
|
+
*
|
|
4
|
+
* Design-system layout (sizes, radii, loading/error UI) is intentionally
|
|
5
|
+
* NOT baked in here — use purpose-built components like `Avatar` instead.
|
|
6
|
+
*
|
|
7
|
+
* What this wrapper adds over a raw RN `Image`:
|
|
8
|
+
* - Accepts a plain URI **string** as `source` (auto-normalized to `{ uri }`).
|
|
9
|
+
* - Extends the prop surface with **web-only** HTML attributes (`sizes`,
|
|
10
|
+
* `loading`, `decoding`, etc.) for better `react-native-web` support.
|
|
11
|
+
* Props already covered by RN 0.81+ (`alt`, `srcSet`, `crossOrigin`,
|
|
12
|
+
* `referrerPolicy`) are inherited from the native typings.
|
|
13
|
+
* - All other props and `ref` are forwarded to the underlying `Image`.
|
|
14
|
+
*
|
|
15
|
+
* Inspired by Expo's html-elements Image primitive:
|
|
16
|
+
* @see https://github.com/expo/expo/blob/main/packages/html-elements/src/primitives/Image.tsx
|
|
17
|
+
*/
|
|
18
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
19
|
+
import { Image as RNImage, type ImageSourcePropType } from 'react-native';
|
|
20
|
+
/**
|
|
21
|
+
* HTML-ish attributes not in RN’s core typings. Forwarded to `Image` with `...props`;
|
|
22
|
+
* **react-native-web** maps supported ones to the DOM `<img>`. On iOS/Android they are
|
|
23
|
+
* typically ignored (no visual effect).
|
|
24
|
+
*/
|
|
25
|
+
export interface WebImageProps {
|
|
26
|
+
/** DOM `sizes` for responsive selection with `srcSet` — web only. */
|
|
27
|
+
sizes?: string;
|
|
28
|
+
/** DOM lazy-loading hint — web only. */
|
|
29
|
+
loading?: 'lazy' | 'eager';
|
|
30
|
+
/** DOM decode hint — web only. */
|
|
31
|
+
decoding?: 'async' | 'auto' | 'sync';
|
|
32
|
+
/** DOM drag behavior — web only. */
|
|
33
|
+
draggable?: boolean;
|
|
34
|
+
/** DOM focus order — web only. */
|
|
35
|
+
tabIndex?: number;
|
|
36
|
+
}
|
|
37
|
+
export type ImageProps = WebImageProps & Omit<ComponentPropsWithoutRef<typeof RNImage>, 'source'> & {
|
|
38
|
+
/** URI string (normalized to `{ uri }`) or standard `ImageSourcePropType`. */
|
|
39
|
+
source: string | ImageSourcePropType;
|
|
40
|
+
className?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const Image: import("react").ForwardRefExoticComponent<WebImageProps & Omit<import("react-native").ImageProps, "source"> & {
|
|
43
|
+
/** URI string (normalized to `{ uri }`) or standard `ImageSourcePropType`. */
|
|
44
|
+
source: string | ImageSourcePropType;
|
|
45
|
+
className?: string;
|
|
46
|
+
} & import("react").RefAttributes<RNImage>>;
|
|
47
|
+
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/Image/Image.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAc,KAAK,wBAAwB,EAAqB,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAgB1E;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACrC,oCAAoC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAOD,MAAM,MAAM,UAAU,GAAG,aAAa,GACpC,IAAI,CAAC,wBAAwB,CAAC,OAAO,OAAO,CAAC,EAAE,QAAQ,CAAC,GAAG;IACzD,8EAA8E;IAC9E,MAAM,EAAE,MAAM,GAAG,mBAAmB,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAMJ,eAAO,MAAM,KAAK;IATd,8EAA8E;YACtE,MAAM,GAAG,mBAAmB;gBACxB,MAAM;2CAYpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -7,6 +7,7 @@ export * from './Card';
|
|
|
7
7
|
export * from './Checkbox';
|
|
8
8
|
export * from './Chip';
|
|
9
9
|
export * from './Dialog';
|
|
10
|
+
export * from './Image';
|
|
10
11
|
export * from './Input';
|
|
11
12
|
export * from './Link';
|
|
12
13
|
export * from './ProgressSegmented';
|
|
@@ -17,4 +18,5 @@ export { HStack, VStack } from './Stack';
|
|
|
17
18
|
export * from './Heading';
|
|
18
19
|
export * from './Text';
|
|
19
20
|
export * from './Icon';
|
|
21
|
+
export * from './IconButton';
|
|
20
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.28",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"@gorhom/bottom-sheet": "^5.2.6",
|
|
66
66
|
"class-variance-authority": "^0.7.1",
|
|
67
67
|
"uniwind": "1.4.1",
|
|
68
|
-
"@cdx-ui/
|
|
69
|
-
"@cdx-ui/
|
|
70
|
-
"@cdx-ui/
|
|
68
|
+
"@cdx-ui/utils": "0.0.1-alpha.28",
|
|
69
|
+
"@cdx-ui/icons": "0.0.1-alpha.28",
|
|
70
|
+
"@cdx-ui/primitives": "0.0.1-alpha.28"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/react": "*",
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Neutral compound-variant **slices** shared by Button and IconButton (no consumer `variant` keys).
|
|
3
|
+
*
|
|
4
|
+
* Each consumer maps these into its own CVA, e.g. filled surface → Button `strong` or IconButton `solid`;
|
|
5
|
+
* ghost surface / outline+ghost foreground → attach the appropriate `variant` / tuple for that component.
|
|
6
|
+
*
|
|
7
|
+
* Button-only outline **surface** (borders) stays in `Button/styles.ts`.
|
|
8
|
+
*/
|
|
9
|
+
import { Platform } from 'react-native';
|
|
10
|
+
import { SEMANTIC_COLORS } from '../../styles/primitives';
|
|
11
|
+
|
|
12
|
+
export type SharedButtonSemanticColor = 'action' | 'danger' | 'warning' | 'success' | 'info';
|
|
13
|
+
|
|
14
|
+
/** Root surface: filled semantic background (maps to Button `strong`, IconButton `solid`). */
|
|
15
|
+
export const sharedFilledSurfaceCompounds: {
|
|
16
|
+
color: SharedButtonSemanticColor;
|
|
17
|
+
mode?: 'dark';
|
|
18
|
+
className: string | string[];
|
|
19
|
+
}[] = [
|
|
20
|
+
{
|
|
21
|
+
color: 'action',
|
|
22
|
+
className: [
|
|
23
|
+
SEMANTIC_COLORS.action.bg,
|
|
24
|
+
Platform.select({
|
|
25
|
+
default: 'data-[active=true]:bg-slate-700',
|
|
26
|
+
web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700',
|
|
27
|
+
}),
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
color: 'danger',
|
|
32
|
+
className: [
|
|
33
|
+
SEMANTIC_COLORS.danger.bg,
|
|
34
|
+
Platform.select({
|
|
35
|
+
default: 'data-[active=true]:bg-red-800',
|
|
36
|
+
web: 'data-[hover=true]:bg-red-700 data-[active=true]:data-[hover=true]:bg-red-800',
|
|
37
|
+
}),
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
color: 'warning',
|
|
42
|
+
className: [
|
|
43
|
+
SEMANTIC_COLORS.warning.bg,
|
|
44
|
+
Platform.select({
|
|
45
|
+
default: 'data-[active=true]:bg-amber-700',
|
|
46
|
+
web: 'data-[hover=true]:bg-amber-600 data-[active=true]:data-[hover=true]:bg-amber-700',
|
|
47
|
+
}),
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
color: 'success',
|
|
52
|
+
className: [
|
|
53
|
+
SEMANTIC_COLORS.success.bg,
|
|
54
|
+
Platform.select({
|
|
55
|
+
default: 'data-[active=true]:bg-green-800',
|
|
56
|
+
web: 'data-[hover=true]:bg-green-700 data-[active=true]:data-[hover=true]:bg-green-800',
|
|
57
|
+
}),
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
color: 'info',
|
|
62
|
+
className: [
|
|
63
|
+
SEMANTIC_COLORS.info.bg,
|
|
64
|
+
Platform.select({
|
|
65
|
+
default: 'data-[active=true]:bg-sky-700',
|
|
66
|
+
web: 'data-[hover=true]:bg-sky-600 data-[active=true]:data-[hover=true]:bg-sky-700',
|
|
67
|
+
}),
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
color: 'action',
|
|
72
|
+
mode: 'dark',
|
|
73
|
+
className: [
|
|
74
|
+
'bg-slate-200',
|
|
75
|
+
Platform.select({
|
|
76
|
+
default: 'data-[active=true]:bg-slate-400',
|
|
77
|
+
web: 'data-[hover=true]:bg-slate-300 data-[active=true]:data-[hover=true]:bg-slate-400',
|
|
78
|
+
}),
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
/** Root surface: ghost hover/active fills (maps to `variant: 'ghost'` on Button and IconButton). */
|
|
84
|
+
export const sharedGhostSurfaceCompounds: {
|
|
85
|
+
color: SharedButtonSemanticColor;
|
|
86
|
+
mode?: 'dark';
|
|
87
|
+
className: string | string[];
|
|
88
|
+
}[] = [
|
|
89
|
+
{
|
|
90
|
+
color: 'danger',
|
|
91
|
+
className: [
|
|
92
|
+
Platform.select({
|
|
93
|
+
default: 'data-[active=true]:bg-red-100',
|
|
94
|
+
web: 'data-[hover=true]:bg-red-50 data-[active=true]:data-[hover=true]:bg-red-100',
|
|
95
|
+
}),
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
color: 'warning',
|
|
100
|
+
className: [
|
|
101
|
+
Platform.select({
|
|
102
|
+
default: 'data-[active=true]:bg-amber-100',
|
|
103
|
+
web: 'data-[hover=true]:bg-amber-50 data-[active=true]:data-[hover=true]:bg-amber-100',
|
|
104
|
+
}),
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
color: 'success',
|
|
109
|
+
className: [
|
|
110
|
+
Platform.select({
|
|
111
|
+
default: 'data-[active=true]:bg-green-100',
|
|
112
|
+
web: 'data-[hover=true]:bg-green-50 data-[active=true]:data-[hover=true]:bg-green-100',
|
|
113
|
+
}),
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
color: 'info',
|
|
118
|
+
className: [
|
|
119
|
+
Platform.select({
|
|
120
|
+
default: 'data-[active=true]:bg-sky-100',
|
|
121
|
+
web: 'data-[hover=true]:bg-sky-50 data-[active=true]:data-[hover=true]:bg-sky-100',
|
|
122
|
+
}),
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
color: 'action',
|
|
127
|
+
mode: 'dark',
|
|
128
|
+
className: [
|
|
129
|
+
Platform.select({
|
|
130
|
+
default: 'data-[active=true]:bg-slate-700',
|
|
131
|
+
web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700',
|
|
132
|
+
}),
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
color: 'danger',
|
|
137
|
+
mode: 'dark',
|
|
138
|
+
className: [
|
|
139
|
+
Platform.select({
|
|
140
|
+
default: 'data-[active=true]:bg-red-950',
|
|
141
|
+
web: 'data-[hover=true]:bg-red-950/50 data-[active=true]:data-[hover=true]:bg-red-950',
|
|
142
|
+
}),
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
color: 'warning',
|
|
147
|
+
mode: 'dark',
|
|
148
|
+
className: [
|
|
149
|
+
Platform.select({
|
|
150
|
+
default: 'data-[active=true]:bg-amber-950',
|
|
151
|
+
web: 'data-[hover=true]:bg-amber-950/50 data-[active=true]:data-[hover=true]:bg-amber-950',
|
|
152
|
+
}),
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
color: 'success',
|
|
157
|
+
mode: 'dark',
|
|
158
|
+
className: [
|
|
159
|
+
Platform.select({
|
|
160
|
+
default: 'data-[active=true]:bg-green-950',
|
|
161
|
+
web: 'data-[hover=true]:bg-green-950/50 data-[active=true]:data-[hover=true]:bg-green-950',
|
|
162
|
+
}),
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
color: 'info',
|
|
167
|
+
mode: 'dark',
|
|
168
|
+
className: [
|
|
169
|
+
Platform.select({
|
|
170
|
+
default: 'data-[active=true]:bg-sky-950',
|
|
171
|
+
web: 'data-[hover=true]:bg-sky-950/50 data-[active=true]:data-[hover=true]:bg-sky-950',
|
|
172
|
+
}),
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
];
|
|
176
|
+
|
|
177
|
+
/** Foreground on filled controls (maps to Button `strong`, IconButton `solid`). */
|
|
178
|
+
export const sharedFilledForegroundTextCompounds: {
|
|
179
|
+
color: SharedButtonSemanticColor;
|
|
180
|
+
mode?: 'dark';
|
|
181
|
+
className: string | string[];
|
|
182
|
+
}[] = [
|
|
183
|
+
{ color: 'action', className: 'text-white' },
|
|
184
|
+
{ color: 'danger', className: 'text-white' },
|
|
185
|
+
{ color: 'warning', className: 'text-white' },
|
|
186
|
+
{ color: 'success', className: 'text-white' },
|
|
187
|
+
{ color: 'info', className: 'text-white' },
|
|
188
|
+
{ color: 'action', mode: 'dark', className: 'text-slate-900' },
|
|
189
|
+
];
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Foreground for transparent controls: same class names for Button `outline` and `ghost`, and for IconButton `ghost`.
|
|
193
|
+
* Consumers attach their own `variant` key(s).
|
|
194
|
+
*/
|
|
195
|
+
export const sharedOutlineGhostForegroundTextCompounds: {
|
|
196
|
+
color: SharedButtonSemanticColor;
|
|
197
|
+
mode?: 'dark';
|
|
198
|
+
className: string | string[];
|
|
199
|
+
}[] = [
|
|
200
|
+
{
|
|
201
|
+
color: 'action',
|
|
202
|
+
className: [
|
|
203
|
+
'text-slate-900',
|
|
204
|
+
Platform.select({
|
|
205
|
+
default: 'data-[active=true]:text-slate-700',
|
|
206
|
+
web: 'data-[hover=true]:text-slate-800 data-[active=true]:data-[hover=true]:text-slate-700',
|
|
207
|
+
}),
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
color: 'danger',
|
|
212
|
+
className: [
|
|
213
|
+
'text-red-600',
|
|
214
|
+
Platform.select({
|
|
215
|
+
default: 'data-[active=true]:text-red-800',
|
|
216
|
+
web: 'data-[hover=true]:text-red-700 data-[active=true]:data-[hover=true]:text-red-800',
|
|
217
|
+
}),
|
|
218
|
+
],
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
color: 'warning',
|
|
222
|
+
className: [
|
|
223
|
+
'text-amber-600',
|
|
224
|
+
Platform.select({
|
|
225
|
+
default: 'data-[active=true]:text-amber-800',
|
|
226
|
+
web: 'data-[hover=true]:text-amber-700 data-[active=true]:data-[hover=true]:text-amber-800',
|
|
227
|
+
}),
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
color: 'success',
|
|
232
|
+
className: [
|
|
233
|
+
'text-green-600',
|
|
234
|
+
Platform.select({
|
|
235
|
+
default: 'data-[active=true]:text-green-800',
|
|
236
|
+
web: 'data-[hover=true]:text-green-700 data-[active=true]:data-[hover=true]:text-green-800',
|
|
237
|
+
}),
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
color: 'info',
|
|
242
|
+
className: [
|
|
243
|
+
'text-sky-600',
|
|
244
|
+
Platform.select({
|
|
245
|
+
default: 'data-[active=true]:text-sky-800',
|
|
246
|
+
web: 'data-[hover=true]:text-sky-700 data-[active=true]:data-[hover=true]:text-sky-800',
|
|
247
|
+
}),
|
|
248
|
+
],
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
color: 'action',
|
|
252
|
+
mode: 'dark',
|
|
253
|
+
className: [
|
|
254
|
+
'text-white',
|
|
255
|
+
Platform.select({
|
|
256
|
+
default: 'data-[active=true]:text-white',
|
|
257
|
+
web: 'data-[hover=true]:text-white data-[active=true]:data-[hover=true]:text-white',
|
|
258
|
+
}),
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
color: 'danger',
|
|
263
|
+
mode: 'dark',
|
|
264
|
+
className: 'text-red-400',
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
color: 'warning',
|
|
268
|
+
mode: 'dark',
|
|
269
|
+
className: 'text-amber-400',
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
color: 'success',
|
|
273
|
+
mode: 'dark',
|
|
274
|
+
className: 'text-green-400',
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
color: 'info',
|
|
278
|
+
mode: 'dark',
|
|
279
|
+
className: 'text-sky-400',
|
|
280
|
+
},
|
|
281
|
+
];
|