@cdx-ui/components 0.0.1-beta.44 → 0.0.1-beta.46
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/styles.js +1 -1
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/Chip/styles.js +1 -1
- package/lib/commonjs/components/Chip/styles.js.map +1 -1
- package/lib/commonjs/components/Input/styles.js +1 -1
- package/lib/commonjs/components/Input/styles.js.map +1 -1
- package/lib/commonjs/components/Link/index.js +22 -3
- package/lib/commonjs/components/Link/index.js.map +1 -1
- package/lib/commonjs/components/Link/styles.js +56 -6
- package/lib/commonjs/components/Link/styles.js.map +1 -1
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js +4 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +1 -1
- package/lib/commonjs/components/Select/index.js +9 -3
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Select/styles.js +17 -20
- package/lib/commonjs/components/Select/styles.js.map +1 -1
- package/lib/commonjs/figma/Field.Select.figma.js +1 -1
- package/lib/commonjs/figma/Link.figma.js +30 -0
- package/lib/commonjs/figma/Link.figma.js.map +1 -0
- package/lib/commonjs/figma/Radio.figma.js +7 -5
- package/lib/commonjs/figma/Radio.figma.js.map +1 -1
- package/lib/commonjs/figma/Select.figma.js +3 -3
- package/lib/commonjs/figma/Select.figma.js.map +1 -1
- package/lib/module/components/Button/styles.js +1 -1
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/Chip/styles.js +1 -1
- package/lib/module/components/Chip/styles.js.map +1 -1
- package/lib/module/components/Input/styles.js +1 -1
- package/lib/module/components/Input/styles.js.map +1 -1
- package/lib/module/components/Link/index.js +25 -6
- package/lib/module/components/Link/index.js.map +1 -1
- package/lib/module/components/Link/styles.js +55 -6
- package/lib/module/components/Link/styles.js.map +1 -1
- package/lib/module/components/Select/SelectTriggerHost.web.js +4 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js.map +1 -1
- package/lib/module/components/Select/index.js +10 -4
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Select/styles.js +18 -21
- package/lib/module/components/Select/styles.js.map +1 -1
- package/lib/module/figma/Field.Select.figma.js +1 -1
- package/lib/module/figma/Link.figma.js +24 -0
- package/lib/module/figma/Link.figma.js.map +1 -0
- package/lib/module/figma/Radio.figma.js +7 -5
- package/lib/module/figma/Radio.figma.js.map +1 -1
- package/lib/module/figma/Select.figma.js +3 -3
- package/lib/module/figma/Select.figma.js.map +1 -1
- package/lib/typescript/components/Input/styles.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +2 -2
- package/lib/typescript/components/Link/index.d.ts.map +1 -1
- package/lib/typescript/components/Link/styles.d.ts +9 -2
- package/lib/typescript/components/Link/styles.d.ts.map +1 -1
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +3 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +1 -1
- package/lib/typescript/components/Select/index.d.ts +1 -1
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/styles.d.ts.map +1 -1
- package/lib/typescript/figma/Link.figma.d.ts +8 -0
- package/lib/typescript/figma/Link.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Radio.figma.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/Button/styles.ts +1 -1
- package/src/components/Chip/styles.ts +1 -1
- package/src/components/Input/styles.ts +2 -1
- package/src/components/Link/index.tsx +22 -9
- package/src/components/Link/styles.ts +49 -9
- package/src/components/Select/SelectTriggerHost.web.tsx +8 -1
- package/src/components/Select/index.tsx +9 -4
- package/src/components/Select/styles.ts +49 -51
|
@@ -6,16 +6,18 @@
|
|
|
6
6
|
import figma from 'figma';
|
|
7
7
|
const instance = figma.selectedInstance;
|
|
8
8
|
|
|
9
|
-
// Enum-as-boolean: isDisabled and isInvalid are VARIANT properties in Figma.
|
|
10
|
-
//
|
|
9
|
+
// Enum-as-boolean: isDisabled and isInvalid are VARIANT properties in Figma (string values "true"/"false").
|
|
10
|
+
// Rendered via renderProp so JSX formatting matches Code Connect conventions.
|
|
11
11
|
const isDisabled = instance.getEnum('isDisabled', {
|
|
12
12
|
true: true,
|
|
13
|
-
false:
|
|
13
|
+
false: false
|
|
14
14
|
});
|
|
15
15
|
const isInvalid = instance.getEnum('isInvalid', {
|
|
16
16
|
true: true,
|
|
17
|
-
false:
|
|
17
|
+
false: false
|
|
18
18
|
});
|
|
19
|
+
const isDisabledProp = figma.helpers.react.renderProp('isDisabled', isDisabled);
|
|
20
|
+
const isInvalidProp = figma.helpers.react.renderProp('isInvalid', isInvalid);
|
|
19
21
|
const showLabel = instance.getEnum('Show Label?', {
|
|
20
22
|
true: true,
|
|
21
23
|
false: false
|
|
@@ -25,7 +27,7 @@ export default {
|
|
|
25
27
|
id: 'radio',
|
|
26
28
|
imports: ["import { Radio } from '@cdx-ui/components'"],
|
|
27
29
|
example: figma.code`
|
|
28
|
-
<Radio value="option"
|
|
30
|
+
<Radio value="option"${isDisabledProp}${isInvalidProp}>
|
|
29
31
|
${showLabel ? figma.code`<Radio.Label>${labelText}</Radio.Label>` : null}
|
|
30
32
|
</Radio>`
|
|
31
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["figma","instance","selectedInstance","isDisabled","getEnum","true","false","
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","isDisabled","getEnum","true","false","isInvalid","isDisabledProp","helpers","react","renderProp","isInvalidProp","showLabel","labelText","findText","textContent","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Radio.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA;AACA,MAAMC,UAAU,GAAGF,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AACF,MAAMC,SAAS,GAAGN,QAAQ,CAACG,OAAO,CAAC,WAAW,EAAE;EAC9CC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AACF,MAAME,cAAc,GAAGR,KAAK,CAACS,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAER,UAAU,CAAC;AAC/E,MAAMS,aAAa,GAAGZ,KAAK,CAACS,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,WAAW,EAAEJ,SAAS,CAAC;AAE5E,MAAMM,SAAS,GAAGZ,QAAQ,CAACG,OAAO,CAAC,aAAa,EAAE;EAChDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AAEF,MAAMQ,SAAS,GAAIb,QAAQ,CAACc,QAAQ,CAAC,OAAO,CAAC,CAAgCC,WAAW;AAExF,eAAe;EACbC,EAAE,EAAE,OAAO;EACXC,OAAO,EAAE,CAAC,4CAA4C,CAAC;EACvDC,OAAO,EAAEnB,KAAK,CAACoB,IAAI;AACrB,uBAAuBZ,cAAc,GAAGI,aAAa;AACrD,IAAIC,SAAS,GAAGb,KAAK,CAACoB,IAAI,gBAAgBN,SAAS,gBAAgB,GAAG,IAAI;AAC1E;AACA,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=427-2296
|
|
4
4
|
// source=packages/components/src/components/Select/index.tsx
|
|
5
5
|
// component=Select
|
|
6
6
|
import figma from 'figma';
|
|
@@ -23,11 +23,11 @@ const isInvalidProp = figma.helpers.react.renderProp('isInvalid', isInvalid);
|
|
|
23
23
|
const isDisabledProp = figma.helpers.react.renderProp('isDisabled', isDisabled);
|
|
24
24
|
const showValue = instance.getEnum('Show Value?', {
|
|
25
25
|
true: true,
|
|
26
|
-
false:
|
|
26
|
+
false: undefined
|
|
27
27
|
});
|
|
28
28
|
const showPlaceholder = instance.getEnum('Show Placeholder?', {
|
|
29
29
|
true: true,
|
|
30
|
-
false:
|
|
30
|
+
false: undefined
|
|
31
31
|
});
|
|
32
32
|
const valueText = instance.findText('{value}', {
|
|
33
33
|
traverseInstances: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["figma","instance","selectedInstance","variant","getEnum","outlined","size","default","isInvalid","true","false","undefined","isDisabled","isInvalidProp","helpers","react","renderProp","isDisabledProp","showValue","showPlaceholder","valueText","findText","traverseInstances","textContent","placeholder","getString","valueProp","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Select.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,OAAO,GAAGF,QAAQ,CAACG,OAAO,CAAC,SAAS,EAAE;EAC1CC,QAAQ,EAAE;AACZ,CAAC,CAAC;AACF,MAAMC,IAAI,GAAGL,QAAQ,CAACG,OAAO,CAAC,MAAM,EAAE;EACpCG,OAAO,EAAE;AACX,CAAC,CAAC;AAEF,MAAMC,SAAS,GAAGP,QAAQ,CAACG,OAAO,CAAC,WAAW,EAAE;EAC9CK,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,UAAU,GAAGX,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDK,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AAEF,MAAME,aAAa,GAAGb,KAAK,CAACc,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,WAAW,EAAER,SAAS,CAAC;AAC5E,MAAMS,cAAc,GAAGjB,KAAK,CAACc,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAEJ,UAAU,CAAC;AAE/E,MAAMM,SAAS,GAAGjB,QAAQ,CAACG,OAAO,CAAC,aAAa,EAAE;EAChDK,IAAI,EAAE,IAAI;EACVC,KAAK,
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","variant","getEnum","outlined","size","default","isInvalid","true","false","undefined","isDisabled","isInvalidProp","helpers","react","renderProp","isDisabledProp","showValue","showPlaceholder","valueText","findText","traverseInstances","textContent","placeholder","getString","valueProp","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Select.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,OAAO,GAAGF,QAAQ,CAACG,OAAO,CAAC,SAAS,EAAE;EAC1CC,QAAQ,EAAE;AACZ,CAAC,CAAC;AACF,MAAMC,IAAI,GAAGL,QAAQ,CAACG,OAAO,CAAC,MAAM,EAAE;EACpCG,OAAO,EAAE;AACX,CAAC,CAAC;AAEF,MAAMC,SAAS,GAAGP,QAAQ,CAACG,OAAO,CAAC,WAAW,EAAE;EAC9CK,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,UAAU,GAAGX,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDK,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AAEF,MAAME,aAAa,GAAGb,KAAK,CAACc,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,WAAW,EAAER,SAAS,CAAC;AAC5E,MAAMS,cAAc,GAAGjB,KAAK,CAACc,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAEJ,UAAU,CAAC;AAE/E,MAAMM,SAAS,GAAGjB,QAAQ,CAACG,OAAO,CAAC,aAAa,EAAE;EAChDK,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMQ,eAAe,GAAGlB,QAAQ,CAACG,OAAO,CAAC,mBAAmB,EAAE;EAC5DK,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AAEF,MAAMS,SAAS,GACbnB,QAAQ,CAACoB,QAAQ,CAAC,SAAS,EAAE;EAC3BC,iBAAiB,EAAE;AACrB,CAAC,CAAC,CACFC,WAAW;AACb,MAAMC,WAAW,GAAGvB,QAAQ,CAACwB,SAAS,CAAC,aAAa,CAAC;AAErD,MAAMC,SAAS,GAAG1B,KAAK,CAACc,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,OAAO,EAAEE,SAAS,GAAG,OAAO,GAAGP,SAAS,CAAC;AAE1F,eAAe;EACbgB,EAAE,EAAE,QAAQ;EACZC,OAAO,EAAE,CAAC,6CAA6C,CAAC;EACxDC,OAAO,EAAE7B,KAAK,CAAC8B,IAAI;AACrB,mBAAmB3B,OAAO,WAAWG,IAAI,uCAAuCc,SAAS,QAAQM,SAAS,GAAGb,aAAa,GAAGI,cAAc;AAC3I;AACA,MAAME,eAAe,GAAGnB,KAAK,CAAC8B,IAAI,8BAA8BN,WAAW,MAAM,GAAGxB,KAAK,CAAC8B,IAAI,kBAAkB;AAChH;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,eAAO,MAAM,iBAAiB;;;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,eAAO,MAAM,iBAAiB;;;8EA0C7B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;8EAmB9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,oFAA4D,CAAC;AAE3F,eAAO,MAAM,iBAAiB;;8EAU5B,CAAC;AAEH,eAAO,MAAM,6BAA6B,oFAAmC,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { Text
|
|
2
|
+
import { Text, View, type TextProps } from 'react-native';
|
|
3
3
|
import { type ILinkProps } from '@cdx-ui/primitives';
|
|
4
4
|
import { type IconProps } from '../Icon';
|
|
5
5
|
export { LinkProvider, type LinkConfig, type LinkAction } from '@cdx-ui/primitives';
|
|
@@ -11,7 +11,7 @@ export interface LinkLabelProps extends TextProps {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
children?: ReactNode;
|
|
13
13
|
}
|
|
14
|
-
declare const LinkLabel: import("react").ForwardRefExoticComponent<LinkLabelProps & import("react").RefAttributes<
|
|
14
|
+
declare const LinkLabel: import("react").ForwardRefExoticComponent<LinkLabelProps & import("react").RefAttributes<Text>>;
|
|
15
15
|
export interface LinkIconProps extends Omit<IconProps, 'children'> {
|
|
16
16
|
}
|
|
17
17
|
declare const LinkIcon: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAuB,IAAI,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAyC,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE5F,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAQ/C,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAUpF,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,4FAQZ,CAAC;AAQH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,SAAS,iGAiBd,CAAC;AAQF,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;CAAG;AAErE,QAAA,MAAM,QAAQ;yCAAwC,aAAa;;CAKlE,CAAC;AAQF,KAAK,qBAAqB,GAAG,OAAO,QAAQ,GAAG;IAC7C,KAAK,EAAE,OAAO,SAAS,CAAC;IACxB,IAAI,EAAE,OAAO,QAAQ,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,IAAI,EAGX,qBAAqB,CAAC"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const linkRootVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
-
export declare const linkLabelVariants: (props?:
|
|
4
|
-
|
|
3
|
+
export declare const linkLabelVariants: (props?: ({
|
|
4
|
+
visited?: boolean | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export declare const linkNativeUnderlineVariants: (props?: ({
|
|
7
|
+
visited?: boolean | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const linkIconVariants: (props?: ({
|
|
10
|
+
visited?: boolean | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
12
|
export type LinkVariantProps = VariantProps<typeof linkLabelVariants>;
|
|
6
13
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,eAAO,MAAM,gBAAgB,oFAc3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;8EAe7B,CAAC;AAEF,eAAO,MAAM,2BAA2B;;8EAQtC,CAAC;AAEH,eAAO,MAAM,gBAAgB;;8EAW5B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PressableProps } from 'react-native';
|
|
3
|
+
import { type DomDataAttributeValue } from '@cdx-ui/primitives';
|
|
3
4
|
export type SelectTriggerHostProps = PressableProps & {
|
|
4
5
|
className?: string;
|
|
6
|
+
dataSet?: Record<string, DomDataAttributeValue>;
|
|
5
7
|
};
|
|
6
8
|
/**
|
|
7
9
|
* Native `<button type="button">` so the trigger is HTML-labelable (`<label htmlFor>` focuses it).
|
|
@@ -9,5 +11,6 @@ export type SelectTriggerHostProps = PressableProps & {
|
|
|
9
11
|
*/
|
|
10
12
|
export declare const SelectTriggerHost: React.ForwardRefExoticComponent<PressableProps & {
|
|
11
13
|
className?: string;
|
|
14
|
+
dataSet?: Record<string, DomDataAttributeValue>;
|
|
12
15
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
13
16
|
//# sourceMappingURL=SelectTriggerHost.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectTriggerHost.web.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/SelectTriggerHost.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectTriggerHost.web.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/SelectTriggerHost.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEnF,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CACjD,CAAC;AAwEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB;gBA9EhB,MAAM;cACR,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC;2CAqIhD,CAAC"}
|
|
@@ -19,7 +19,7 @@ declare const SelectValue: import("react").ForwardRefExoticComponent<SelectValue
|
|
|
19
19
|
export interface SelectIconProps extends Omit<IconProps, 'children'> {
|
|
20
20
|
}
|
|
21
21
|
declare const SelectIcon: {
|
|
22
|
-
({ className, style, ...props }: SelectIconProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
({ className, style, as: IconComponent, ...props }: SelectIconProps): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
displayName: string;
|
|
24
24
|
};
|
|
25
25
|
export interface SelectContentProps extends ViewProps, ISelectContentProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAa,IAAI,EAAE,KAAK,SAAS,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAErF,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAQ,SAAS,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EACL,KAAK,kBAAkB,EAOxB,MAAM,UAAU,CAAC;AAsBlB,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,YAAY,EAAE,kBAAkB;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,8FAcf,CAAC;AAQF,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,aAAa,qGAalB,CAAC;AAQF,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,iBAAiB;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,WAAW,mGAMf,CAAC;AAQH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;CAAG;AAEvE,QAAA,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAa,IAAI,EAAE,KAAK,SAAS,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAErF,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAQ,SAAS,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EACL,KAAK,kBAAkB,EAOxB,MAAM,UAAU,CAAC;AAsBlB,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,YAAY,EAAE,kBAAkB;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,8FAcf,CAAC;AAQF,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,aAAa,qGAalB,CAAC;AAQF,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,iBAAiB;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,WAAW,mGAMf,CAAC;AAQH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;CAAG;AAEvE,QAAA,MAAM,UAAU;wDAAuD,eAAe;;CAWrF,CAAC;AAQF,MAAM,WAAW,kBAAmB,SAAQ,SAAS,EAAE,mBAAmB;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,aAAa,qGAQlB,CAAC;AAQF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,UAAU,kGAYf,CAAC;AAQF,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,qBAAqB;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,eAAe,uGAUpB,CAAC;AAQF,KAAK,uBAAuB,GAAG,OAAO,UAAU,GAAG;IACjD,OAAO,EAAE,OAAO,aAAa,CAAC;IAC9B,KAAK,EAAE,OAAO,WAAW,CAAC;IAC1B,IAAI,EAAE,OAAO,UAAU,CAAC;IACxB,OAAO,EAAE,OAAO,aAAa,CAAC;IAC9B,IAAI,EAAE,OAAO,UAAU,CAAC;IACxB,SAAS,EAAE,OAAO,eAAe,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,MAAM,EAOb,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,eAAO,MAAM,qBAAqB;;;8EAgDjC,CAAC;AAIF,eAAO,MAAM,mBAAmB;;8EAkB/B,CAAC;AAIF,eAAO,MAAM,kBAAkB;;8EAkB9B,CAAC;AAIF,eAAO,MAAM,qBAAqB,oFAWhC,CAAC;AAIH,eAAO,MAAM,kBAAkB;;8EAsB9B,CAAC;AAIF,eAAO,MAAM,uBAAuB;;8EAanC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/Link.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;AAa1B,wBAOE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/Radio.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;
|
|
1
|
+
{"version":3,"file":"Radio.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/Radio.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;AAwB1B,wBAOE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.46",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"@gorhom/bottom-sheet": "^5.2.6",
|
|
68
68
|
"class-variance-authority": "^0.7.1",
|
|
69
69
|
"uniwind": "1.6.1",
|
|
70
|
-
"@cdx-ui/primitives": "0.0.1-beta.
|
|
71
|
-
"@cdx-ui/utils": "0.0.1-beta.
|
|
72
|
-
"@cdx-ui/icons": "0.0.1-beta.
|
|
70
|
+
"@cdx-ui/primitives": "0.0.1-beta.46",
|
|
71
|
+
"@cdx-ui/utils": "0.0.1-beta.46",
|
|
72
|
+
"@cdx-ui/icons": "0.0.1-beta.46"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/react": "*",
|
|
@@ -12,7 +12,7 @@ export const buttonRootVariants = cva(
|
|
|
12
12
|
TRANSITION_COLORS,
|
|
13
13
|
'data-[disabled=true]:opacity-[var(--opacity-disabled)]',
|
|
14
14
|
DISABLED_CURSOR,
|
|
15
|
-
'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-
|
|
15
|
+
'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-stroke-focus web:data-[focus-visible=true]:ring-offset-2',
|
|
16
16
|
],
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
@@ -9,7 +9,7 @@ const chipInteractiveRoot = [
|
|
|
9
9
|
Platform.select({
|
|
10
10
|
web: [
|
|
11
11
|
'outline-none',
|
|
12
|
-
'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-
|
|
12
|
+
'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-stroke-focus web:data-[focus-visible=true]:ring-offset-2',
|
|
13
13
|
].join(' '),
|
|
14
14
|
default: '',
|
|
15
15
|
}),
|
|
@@ -5,7 +5,8 @@ export const inputRootVariants = cva(
|
|
|
5
5
|
[
|
|
6
6
|
'w-full flex-row items-center overflow-hidden',
|
|
7
7
|
'bg-surface-primary',
|
|
8
|
-
'border-solid border-
|
|
8
|
+
'border-solid border-stroke-primary',
|
|
9
|
+
'web:border-default native:border-[length:var(--border-width-default)]',
|
|
9
10
|
'rounded-[var(--border-radius-default)]',
|
|
10
11
|
TRANSITION_COLORS,
|
|
11
12
|
'data-[disabled=true]:bg-surface-secondary',
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { forwardRef, type ReactNode } from 'react';
|
|
2
|
-
import { Pressable, Text
|
|
3
|
-
import { createLink, type ILinkProps } from '@cdx-ui/primitives';
|
|
2
|
+
import { Platform, Pressable, Text, View, type TextProps } from 'react-native';
|
|
3
|
+
import { createLink, useLinkInteractionContext, type ILinkProps } from '@cdx-ui/primitives';
|
|
4
4
|
import { cn } from '@cdx-ui/utils';
|
|
5
5
|
import { Icon, type IconProps } from '../Icon';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
linkIconVariants,
|
|
8
|
+
linkLabelVariants,
|
|
9
|
+
linkNativeUnderlineVariants,
|
|
10
|
+
linkRootVariants,
|
|
11
|
+
} from './styles';
|
|
7
12
|
|
|
8
13
|
export { LinkProvider, type LinkConfig, type LinkAction } from '@cdx-ui/primitives';
|
|
9
14
|
|
|
@@ -40,15 +45,22 @@ export interface LinkLabelProps extends TextProps {
|
|
|
40
45
|
children?: ReactNode;
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
const LinkLabel = forwardRef<
|
|
48
|
+
const LinkLabel = forwardRef<Text, LinkLabelProps>(
|
|
44
49
|
({ className, children, style, ...props }, ref) => {
|
|
45
|
-
const
|
|
50
|
+
const { visited } = useLinkInteractionContext();
|
|
51
|
+
const computedClassName = cn(linkLabelVariants({ visited }), className);
|
|
46
52
|
|
|
47
|
-
|
|
48
|
-
<
|
|
53
|
+
const textElement = (
|
|
54
|
+
<Text ref={ref} className={computedClassName} style={style} {...props}>
|
|
49
55
|
{children}
|
|
50
|
-
</
|
|
56
|
+
</Text>
|
|
51
57
|
);
|
|
58
|
+
|
|
59
|
+
if (Platform.OS === 'web') {
|
|
60
|
+
return textElement;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return <View className={cn(linkNativeUnderlineVariants({ visited }))}>{textElement}</View>;
|
|
52
64
|
},
|
|
53
65
|
);
|
|
54
66
|
|
|
@@ -61,7 +73,8 @@ LinkLabel.displayName = 'Link.Label';
|
|
|
61
73
|
export interface LinkIconProps extends Omit<IconProps, 'children'> {}
|
|
62
74
|
|
|
63
75
|
const LinkIcon = ({ className, style, as, ...props }: LinkIconProps) => {
|
|
64
|
-
const
|
|
76
|
+
const { visited } = useLinkInteractionContext();
|
|
77
|
+
const computedClassName = cn(linkIconVariants({ visited }), className);
|
|
65
78
|
|
|
66
79
|
return <Icon as={as} className={computedClassName} style={style} {...props} />;
|
|
67
80
|
};
|
|
@@ -1,21 +1,61 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
1
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
3
|
import { TRANSITION_COLORS } from '../../styles/primitives';
|
|
3
4
|
|
|
4
|
-
// TODO: Handle visited state
|
|
5
|
-
|
|
6
5
|
export const linkRootVariants = cva([
|
|
7
6
|
'flex-row items-center gap-1',
|
|
8
|
-
|
|
7
|
+
Platform.select({ web: 'web:inline-flex web:self-start', default: '' }),
|
|
9
8
|
TRANSITION_COLORS,
|
|
9
|
+
'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
|
|
10
|
+
'web:data-[focus-visible=true]:rounded-[2px]',
|
|
10
11
|
'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-stroke-focus web:data-[focus-visible=true]:ring-offset-2',
|
|
12
|
+
// Web: set color on the anchor so Label/Icon can text-inherit (incl. browser :visited).
|
|
13
|
+
'web:text-content-link',
|
|
14
|
+
'web:visited:text-content-link-visited',
|
|
15
|
+
'web:hover:text-content-primary',
|
|
16
|
+
'web:visited:hover:text-content-primary',
|
|
17
|
+
'data-[visited=true]:text-content-link-visited',
|
|
18
|
+
'web:data-[hover=true]:text-content-primary',
|
|
11
19
|
]);
|
|
12
20
|
|
|
13
|
-
export const linkLabelVariants = cva(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
export const linkLabelVariants = cva(
|
|
22
|
+
[
|
|
23
|
+
'body-md',
|
|
24
|
+
Platform.select({ web: 'underline underline-offset-4', default: '' }),
|
|
25
|
+
Platform.select({ web: 'text-inherit', default: 'text-content-link' }),
|
|
26
|
+
],
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
visited: {
|
|
30
|
+
true: Platform.select({ web: '', default: 'text-content-link-visited' }),
|
|
31
|
+
false: '',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: { visited: false },
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export const linkNativeUnderlineVariants = cva(['border-b border-content-link pb-0.5'], {
|
|
39
|
+
variants: {
|
|
40
|
+
visited: {
|
|
41
|
+
true: 'border-content-link-visited',
|
|
42
|
+
false: '',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: { visited: false },
|
|
46
|
+
});
|
|
18
47
|
|
|
19
|
-
export const linkIconVariants = cva(
|
|
48
|
+
export const linkIconVariants = cva(
|
|
49
|
+
['size-4', Platform.select({ web: 'text-inherit', default: 'text-content-link' })],
|
|
50
|
+
{
|
|
51
|
+
variants: {
|
|
52
|
+
visited: {
|
|
53
|
+
true: Platform.select({ web: '', default: 'text-content-link-visited' }),
|
|
54
|
+
false: '',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
defaultVariants: { visited: false },
|
|
58
|
+
},
|
|
59
|
+
);
|
|
20
60
|
|
|
21
61
|
export type LinkVariantProps = VariantProps<typeof linkLabelVariants>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
import type { PressableProps } from 'react-native';
|
|
4
|
+
import { domDataAttributes, type DomDataAttributeValue } from '@cdx-ui/primitives';
|
|
4
5
|
|
|
5
|
-
export type SelectTriggerHostProps = PressableProps & {
|
|
6
|
+
export type SelectTriggerHostProps = PressableProps & {
|
|
7
|
+
className?: string;
|
|
8
|
+
dataSet?: Record<string, DomDataAttributeValue>;
|
|
9
|
+
};
|
|
6
10
|
|
|
7
11
|
/** Props that must not be forwarded to a DOM `<button>`. */
|
|
8
12
|
const OMIT = new Set<string>([
|
|
@@ -91,16 +95,19 @@ export const SelectTriggerHost = forwardRef<HTMLButtonElement, SelectTriggerHost
|
|
|
91
95
|
style,
|
|
92
96
|
className,
|
|
93
97
|
testID,
|
|
98
|
+
dataSet,
|
|
94
99
|
...rest
|
|
95
100
|
} = props;
|
|
96
101
|
|
|
97
102
|
const domProps = filterDomProps(rest);
|
|
103
|
+
const dataAttrs = domDataAttributes(dataSet ?? {});
|
|
98
104
|
const flattened = StyleSheet.flatten(style) as React.CSSProperties | undefined;
|
|
99
105
|
|
|
100
106
|
return (
|
|
101
107
|
<button
|
|
102
108
|
ref={ref}
|
|
103
109
|
{...domProps}
|
|
110
|
+
{...dataAttrs}
|
|
104
111
|
type="button"
|
|
105
112
|
disabled={!!disabled}
|
|
106
113
|
className={typeof className === 'string' ? className : undefined}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef, type ReactNode } from 'react';
|
|
2
2
|
import { Pressable, Text, type TextProps, View, type ViewProps } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { KeyboardArrowDown } from '@cdx-ui/icons';
|
|
4
4
|
import {
|
|
5
5
|
createSelect,
|
|
6
6
|
type ISelectContentProps,
|
|
@@ -83,7 +83,7 @@ const SelectTrigger = forwardRef<View, SelectTriggerProps>(
|
|
|
83
83
|
return (
|
|
84
84
|
<SelectPrimitive.Trigger ref={ref} className={computedClassName} style={style} {...props}>
|
|
85
85
|
{children}
|
|
86
|
-
<SelectIcon as={
|
|
86
|
+
<SelectIcon as={KeyboardArrowDown} />
|
|
87
87
|
</SelectPrimitive.Trigger>
|
|
88
88
|
);
|
|
89
89
|
},
|
|
@@ -115,12 +115,17 @@ SelectValue.displayName = 'Select.Value';
|
|
|
115
115
|
|
|
116
116
|
export interface SelectIconProps extends Omit<IconProps, 'children'> {}
|
|
117
117
|
|
|
118
|
-
const SelectIcon = ({ className, style, ...props }: SelectIconProps) => {
|
|
118
|
+
const SelectIcon = ({ className, style, as: IconComponent, ...props }: SelectIconProps) => {
|
|
119
119
|
const { size } = useSelectStyleContext();
|
|
120
120
|
|
|
121
121
|
const computedClassName = cn(selectIconVariants({ size }), className);
|
|
122
|
+
const iconSizeClass = size === 'small' ? 'size-4' : 'size-5';
|
|
122
123
|
|
|
123
|
-
return
|
|
124
|
+
return (
|
|
125
|
+
<SelectPrimitive.Icon className={computedClassName} style={style}>
|
|
126
|
+
<Icon as={IconComponent} className={iconSizeClass} {...props} />
|
|
127
|
+
</SelectPrimitive.Icon>
|
|
128
|
+
);
|
|
124
129
|
};
|
|
125
130
|
|
|
126
131
|
SelectIcon.displayName = 'Select.Icon';
|
|
@@ -1,44 +1,29 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
import {
|
|
4
|
-
COLOR_BG_PRIMARY,
|
|
5
|
-
COLOR_BORDER_DEFAULT,
|
|
6
|
-
COLOR_TEXT_MUTED,
|
|
7
|
-
COLOR_TEXT_PRIMARY,
|
|
8
|
-
DISABLED_CURSOR,
|
|
9
|
-
DISABLED_OPACITY,
|
|
10
|
-
RADIUS_SM,
|
|
11
|
-
RADIUS_MD,
|
|
12
|
-
SHADOW_SM,
|
|
13
|
-
SHADOW_MD,
|
|
14
|
-
SIZE_SCALE,
|
|
15
|
-
TRANSITION_COLORS,
|
|
16
|
-
} from '../../styles/primitives';
|
|
3
|
+
import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
17
4
|
|
|
18
5
|
// ── Trigger ─────────────────────────────────────────────────
|
|
19
6
|
|
|
20
7
|
export const selectTriggerVariants = cva(
|
|
21
8
|
[
|
|
22
9
|
'flex w-full min-w-0 flex-row items-center justify-between text-start',
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
'bg-surface-primary',
|
|
11
|
+
'border border-stroke-primary',
|
|
12
|
+
'rounded-[var(--border-radius-default)]',
|
|
25
13
|
TRANSITION_COLORS,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
DISABLED_OPACITY,
|
|
14
|
+
'data-[disabled=true]:bg-surface-secondary',
|
|
15
|
+
'data-[disabled=true]:opacity-[var(--opacity-disabled)]',
|
|
29
16
|
DISABLED_CURSOR,
|
|
30
17
|
'data-[readonly=true]:cursor-default',
|
|
31
|
-
'data-[
|
|
32
|
-
'data-[
|
|
33
|
-
'data-[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
].join(' '),
|
|
41
|
-
}),
|
|
18
|
+
'data-[readonly=true]:bg-surface-secondary',
|
|
19
|
+
'web:data-[hover=true]:data-[focus=false]:data-[invalid=false]:border-stroke-hover',
|
|
20
|
+
'data-[focus=true]:border-[length:var(--border-width-focused)]',
|
|
21
|
+
'data-[focus=true]:data-[invalid=false]:border-stroke-action',
|
|
22
|
+
'data-[focus=true]:data-[invalid=true]:border-stroke-danger',
|
|
23
|
+
'data-[state=open]:border-[length:var(--border-width-focused)]',
|
|
24
|
+
'data-[state=open]:data-[invalid=false]:border-stroke-action',
|
|
25
|
+
'data-[state=open]:data-[invalid=true]:border-stroke-danger',
|
|
26
|
+
'data-[invalid=true]:border-stroke-danger',
|
|
42
27
|
],
|
|
43
28
|
{
|
|
44
29
|
variants: {
|
|
@@ -46,8 +31,20 @@ export const selectTriggerVariants = cva(
|
|
|
46
31
|
outline: [],
|
|
47
32
|
},
|
|
48
33
|
size: {
|
|
49
|
-
default:
|
|
50
|
-
|
|
34
|
+
default: [
|
|
35
|
+
'h-11 min-h-11 px-4 py-3 gap-4',
|
|
36
|
+
'data-[focus=true]:px-[calc(var(--spacing-4)-var(--spacing-px))]',
|
|
37
|
+
'data-[focus=true]:py-[calc(var(--spacing-3)-var(--spacing-px))]',
|
|
38
|
+
'data-[state=open]:px-[calc(var(--spacing-4)-var(--spacing-px))]',
|
|
39
|
+
'data-[state=open]:py-[calc(var(--spacing-3)-var(--spacing-px))]',
|
|
40
|
+
],
|
|
41
|
+
small: [
|
|
42
|
+
'h-8 min-h-8 px-3 py-2 gap-1.5',
|
|
43
|
+
'data-[focus=true]:px-[calc(var(--spacing-3)-var(--spacing-px))]',
|
|
44
|
+
'data-[focus=true]:py-[calc(var(--spacing-2)-var(--spacing-px))]',
|
|
45
|
+
'data-[state=open]:px-[calc(var(--spacing-3)-var(--spacing-px))]',
|
|
46
|
+
'data-[state=open]:py-[calc(var(--spacing-2)-var(--spacing-px))]',
|
|
47
|
+
],
|
|
51
48
|
},
|
|
52
49
|
},
|
|
53
50
|
defaultVariants: {
|
|
@@ -62,15 +59,15 @@ export const selectTriggerVariants = cva(
|
|
|
62
59
|
export const selectValueVariants = cva(
|
|
63
60
|
[
|
|
64
61
|
'min-w-0 flex-1 text-start',
|
|
65
|
-
'
|
|
66
|
-
'data-[
|
|
67
|
-
|
|
62
|
+
'text-content-primary',
|
|
63
|
+
'data-[placeholder=true]:text-content-tertiary',
|
|
64
|
+
'data-[invalid=true]:text-content-danger',
|
|
68
65
|
],
|
|
69
66
|
{
|
|
70
67
|
variants: {
|
|
71
68
|
size: {
|
|
72
|
-
default:
|
|
73
|
-
small:
|
|
69
|
+
default: 'text-[0.875rem]',
|
|
70
|
+
small: 'text-[0.75rem]',
|
|
74
71
|
},
|
|
75
72
|
},
|
|
76
73
|
defaultVariants: {
|
|
@@ -84,14 +81,15 @@ export const selectValueVariants = cva(
|
|
|
84
81
|
export const selectIconVariants = cva(
|
|
85
82
|
[
|
|
86
83
|
'shrink-0 items-center justify-center self-center',
|
|
87
|
-
|
|
88
|
-
'data-[invalid=true]:text-
|
|
84
|
+
'text-content-tertiary',
|
|
85
|
+
'data-[invalid=true]:text-content-danger',
|
|
86
|
+
'data-[state=open]:rotate-180',
|
|
89
87
|
],
|
|
90
88
|
{
|
|
91
89
|
variants: {
|
|
92
90
|
size: {
|
|
93
|
-
default: '
|
|
94
|
-
small: '
|
|
91
|
+
default: 'size-5',
|
|
92
|
+
small: 'size-4',
|
|
95
93
|
},
|
|
96
94
|
},
|
|
97
95
|
defaultVariants: {
|
|
@@ -103,12 +101,12 @@ export const selectIconVariants = cva(
|
|
|
103
101
|
// ── Content ─────────────────────────────────────────────────
|
|
104
102
|
|
|
105
103
|
export const selectContentVariants = cva([
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
'bg-surface-primary',
|
|
105
|
+
'border border-stroke-secondary',
|
|
108
106
|
'overflow-hidden',
|
|
109
|
-
|
|
107
|
+
'rounded-xl',
|
|
110
108
|
Platform.select({
|
|
111
|
-
web:
|
|
109
|
+
web: 'shadow-sm',
|
|
112
110
|
default: '',
|
|
113
111
|
}),
|
|
114
112
|
'max-h-60',
|
|
@@ -122,10 +120,10 @@ export const selectItemVariants = cva(
|
|
|
122
120
|
'flex-row items-center',
|
|
123
121
|
'transition-colors duration-100',
|
|
124
122
|
'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none',
|
|
125
|
-
'data-[state=checked]:bg-
|
|
123
|
+
'data-[state=checked]:bg-surface-action-tint data-[state=checked]:font-medium',
|
|
126
124
|
Platform.select({
|
|
127
|
-
default: 'data-[active=true]:bg-
|
|
128
|
-
web: 'data-[hover=true]:bg-
|
|
125
|
+
default: 'data-[active=true]:bg-surface-action-tint-active',
|
|
126
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active data-[highlighted=true]:bg-surface-action-tint-hover',
|
|
129
127
|
}),
|
|
130
128
|
],
|
|
131
129
|
{
|
|
@@ -144,12 +142,12 @@ export const selectItemVariants = cva(
|
|
|
144
142
|
// ── ItemLabel ───────────────────────────────────────────────
|
|
145
143
|
|
|
146
144
|
export const selectItemLabelVariants = cva(
|
|
147
|
-
[
|
|
145
|
+
['text-content-primary', 'data-[state=checked]:font-medium'],
|
|
148
146
|
{
|
|
149
147
|
variants: {
|
|
150
148
|
size: {
|
|
151
|
-
default:
|
|
152
|
-
small:
|
|
149
|
+
default: 'text-[0.875rem]',
|
|
150
|
+
small: 'text-[0.75rem]',
|
|
153
151
|
},
|
|
154
152
|
},
|
|
155
153
|
defaultVariants: {
|