@cdx-ui/components 0.0.1-alpha.33 → 0.0.1-alpha.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/lib/commonjs/components/Button/index.js +4 -11
  2. package/lib/commonjs/components/Button/index.js.map +1 -1
  3. package/lib/commonjs/components/Button/styles.js +148 -112
  4. package/lib/commonjs/components/Button/styles.js.map +1 -1
  5. package/lib/commonjs/components/Heading/styles.js +6 -7
  6. package/lib/commonjs/components/Heading/styles.js.map +1 -1
  7. package/lib/commonjs/components/IconButton/index.js +2 -7
  8. package/lib/commonjs/components/IconButton/index.js.map +1 -1
  9. package/lib/commonjs/components/IconButton/styles.js +15 -62
  10. package/lib/commonjs/components/IconButton/styles.js.map +1 -1
  11. package/lib/commonjs/components/Input/styles.js +10 -9
  12. package/lib/commonjs/components/Input/styles.js.map +1 -1
  13. package/lib/commonjs/components/Link/styles.js +5 -7
  14. package/lib/commonjs/components/Link/styles.js.map +1 -1
  15. package/lib/commonjs/components/ProgressBar/index.js +45 -0
  16. package/lib/commonjs/components/ProgressBar/index.js.map +1 -0
  17. package/lib/commonjs/components/ProgressBar/styles.js +10 -0
  18. package/lib/commonjs/components/ProgressBar/styles.js.map +1 -0
  19. package/lib/commonjs/components/ProgressSegmented/styles.js +5 -5
  20. package/lib/commonjs/components/ProgressSegmented/styles.js.map +1 -1
  21. package/lib/commonjs/components/Text/styles.js +6 -7
  22. package/lib/commonjs/components/Text/styles.js.map +1 -1
  23. package/lib/commonjs/components/index.js +12 -0
  24. package/lib/commonjs/components/index.js.map +1 -1
  25. package/lib/module/components/Button/index.js +4 -11
  26. package/lib/module/components/Button/index.js.map +1 -1
  27. package/lib/module/components/Button/styles.js +149 -112
  28. package/lib/module/components/Button/styles.js.map +1 -1
  29. package/lib/module/components/Heading/styles.js +6 -7
  30. package/lib/module/components/Heading/styles.js.map +1 -1
  31. package/lib/module/components/IconButton/index.js +2 -7
  32. package/lib/module/components/IconButton/index.js.map +1 -1
  33. package/lib/module/components/IconButton/styles.js +16 -63
  34. package/lib/module/components/IconButton/styles.js.map +1 -1
  35. package/lib/module/components/Input/styles.js +11 -10
  36. package/lib/module/components/Input/styles.js.map +1 -1
  37. package/lib/module/components/Link/styles.js +6 -7
  38. package/lib/module/components/Link/styles.js.map +1 -1
  39. package/lib/module/components/ProgressBar/index.js +41 -0
  40. package/lib/module/components/ProgressBar/index.js.map +1 -0
  41. package/lib/module/components/ProgressBar/styles.js +6 -0
  42. package/lib/module/components/ProgressBar/styles.js.map +1 -0
  43. package/lib/module/components/ProgressSegmented/styles.js +5 -5
  44. package/lib/module/components/ProgressSegmented/styles.js.map +1 -1
  45. package/lib/module/components/Text/styles.js +6 -7
  46. package/lib/module/components/Text/styles.js.map +1 -1
  47. package/lib/module/components/index.js +1 -0
  48. package/lib/module/components/index.js.map +1 -1
  49. package/lib/typescript/components/Button/index.d.ts.map +1 -1
  50. package/lib/typescript/components/Button/styles.d.ts +3 -6
  51. package/lib/typescript/components/Button/styles.d.ts.map +1 -1
  52. package/lib/typescript/components/Heading/styles.d.ts.map +1 -1
  53. package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
  54. package/lib/typescript/components/IconButton/styles.d.ts +1 -6
  55. package/lib/typescript/components/IconButton/styles.d.ts.map +1 -1
  56. package/lib/typescript/components/Input/styles.d.ts.map +1 -1
  57. package/lib/typescript/components/Link/styles.d.ts +2 -0
  58. package/lib/typescript/components/Link/styles.d.ts.map +1 -1
  59. package/lib/typescript/components/ProgressBar/index.d.ts +17 -0
  60. package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -0
  61. package/lib/typescript/components/ProgressBar/styles.d.ts +5 -0
  62. package/lib/typescript/components/ProgressBar/styles.d.ts.map +1 -0
  63. package/lib/typescript/components/ProgressSegmented/styles.d.ts.map +1 -1
  64. package/lib/typescript/components/Text/styles.d.ts.map +1 -1
  65. package/lib/typescript/components/index.d.ts +1 -0
  66. package/lib/typescript/components/index.d.ts.map +1 -1
  67. package/package.json +5 -5
  68. package/src/components/Button/index.tsx +6 -10
  69. package/src/components/Button/styles.ts +127 -138
  70. package/src/components/Heading/styles.tsx +6 -7
  71. package/src/components/IconButton/index.tsx +2 -3
  72. package/src/components/IconButton/styles.ts +18 -90
  73. package/src/components/Input/styles.ts +26 -35
  74. package/src/components/Link/styles.ts +12 -11
  75. package/src/components/ProgressBar/index.tsx +53 -0
  76. package/src/components/ProgressBar/styles.ts +9 -0
  77. package/src/components/ProgressSegmented/styles.ts +6 -5
  78. package/src/components/Text/styles.tsx +6 -7
  79. package/src/components/index.ts +1 -0
  80. package/lib/commonjs/components/Button/buttonSharedVariants.js +0 -200
  81. package/lib/commonjs/components/Button/buttonSharedVariants.js.map +0 -1
  82. package/lib/module/components/Button/buttonSharedVariants.js +0 -195
  83. package/lib/module/components/Button/buttonSharedVariants.js.map +0 -1
  84. package/lib/typescript/components/Button/buttonSharedVariants.d.ts +0 -29
  85. package/lib/typescript/components/Button/buttonSharedVariants.d.ts.map +0 -1
  86. package/src/components/Button/buttonSharedVariants.ts +0 -281
@@ -1,45 +1,35 @@
1
1
  import { cva, type VariantProps } from 'class-variance-authority';
2
- import {
3
- COLOR_BG_PRIMARY,
4
- COLOR_BORDER_DEFAULT,
5
- COLOR_TEXT_MUTED,
6
- COLOR_TEXT_PRIMARY,
7
- DISABLED_CURSOR,
8
- DISABLED_OPACITY,
9
- RADIUS_SM,
10
- SHADOW_SM,
11
- SIZE_SCALE,
12
- TRANSITION_COLORS,
13
- } from '../../styles/primitives';
2
+ import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
14
3
 
15
4
  export const inputRootVariants = cva(
16
5
  [
17
- 'w-full flex-row items-stretch border',
18
- COLOR_BG_PRIMARY,
19
- COLOR_BORDER_DEFAULT,
20
- RADIUS_SM,
21
- SHADOW_SM,
6
+ 'w-full flex-row items-stretch overflow-hidden',
7
+ 'bg-surface-primary',
8
+ 'border-solid border-[length:var(--border-width-default)] border-stroke-primary',
9
+ 'rounded-[var(--border-radius-default)]',
22
10
  TRANSITION_COLORS,
23
- DISABLED_OPACITY,
11
+ 'data-[disabled=true]:bg-surface-secondary',
12
+ 'data-[disabled=true]:opacity-[--opacity-disabled]',
24
13
  DISABLED_CURSOR,
25
- 'data-[disabled=true]:bg-slate-50 data-[disabled=true]:border-slate-300',
26
14
  'data-[readonly=true]:cursor-default',
27
- 'data-[readonly=true]:bg-slate-50',
28
- 'web:data-[hover=true]:data-[active=false]:border-slate-300',
29
- 'data-[focus=true]:border-slate-900',
30
- 'data-[invalid=true]:border-red-500',
15
+ 'data-[readonly=true]:bg-surface-secondary',
16
+ 'web:data-[hover=true]:data-[focus=false]:data-[invalid=false]:border-stroke-hover',
17
+ 'data-[focus=true]:border-[length:var(--border-width-focused)]',
18
+ 'data-[focus=true]:border-stroke-action',
19
+ 'data-[invalid=true]:border-stroke-danger',
31
20
  ],
32
21
  {
33
22
  variants: {
34
23
  variant: {
35
- outline: [
36
- 'web:focus-within:border-slate-900 web:focus-within:ring-2 web:focus-within:ring-slate-400/50 web:focus-within:ring-offset-0',
37
- 'web:data-[invalid=true]:focus-within:border-red-500 web:data-[invalid=true]:focus-within:ring-2 web:data-[invalid=true]:focus-within:ring-red-400/50',
38
- ],
24
+ outline: [],
39
25
  },
40
26
  size: {
41
- default: `${SIZE_SCALE.default.height} ${SIZE_SCALE.default.px} py-2 ${SIZE_SCALE.default.gap}`,
42
- small: `${SIZE_SCALE.small.height} ${SIZE_SCALE.small.px} py-1.5 ${SIZE_SCALE.small.gap}`,
27
+ // TODO: Find a cleaner approach to preventing layout shift when focus border is applied.
28
+ default: ['h-10 px-4 py-2 gap-2', 'data-[focus=true]:px-[15px] data-[focus=true]:py-[7px]'],
29
+ small: [
30
+ 'h-8 px-3 py-1.5 gap-1.5',
31
+ 'data-[focus=true]:px-[11px] data-[focus=true]:py-[5px]',
32
+ ],
43
33
  },
44
34
  },
45
35
  defaultVariants: {
@@ -52,15 +42,16 @@ export const inputRootVariants = cva(
52
42
  export const inputFieldVariants = cva(
53
43
  [
54
44
  'flex-1 justify-center bg-transparent p-0',
55
- COLOR_TEXT_PRIMARY,
56
- 'placeholder:text-slate-400',
45
+ 'font-body text-content-primary',
46
+ 'placeholder:text-content-tertiary',
57
47
  'web:outline-none',
48
+ 'tracking-normal',
58
49
  ],
59
50
  {
60
51
  variants: {
61
52
  size: {
62
- default: 'text-[1rem]',
63
- small: 'text-[0.875rem]',
53
+ default: 'text-[0.875rem]',
54
+ small: 'text-[0.75rem]',
64
55
  },
65
56
  },
66
57
  defaultVariants: {
@@ -71,7 +62,7 @@ export const inputFieldVariants = cva(
71
62
 
72
63
  export const inputSlotVariants = cva(['items-center justify-center self-center']);
73
64
 
74
- export const inputIconVariants = cva([COLOR_TEXT_MUTED], {
65
+ export const inputIconVariants = cva(['text-content-tertiary'], {
75
66
  variants: {
76
67
  size: {
77
68
  default: 'size-5',
@@ -83,6 +74,6 @@ export const inputIconVariants = cva([COLOR_TEXT_MUTED], {
83
74
  },
84
75
  });
85
76
 
86
- export const inputFieldPlaceholderVariants = cva(['accent-slate-400']);
77
+ export const inputFieldPlaceholderVariants = cva(['accent-content-tertiary']);
87
78
 
88
79
  export type InputVariantProps = VariantProps<typeof inputRootVariants>;
@@ -1,20 +1,21 @@
1
- import { Platform } from 'react-native';
2
- import { cva } from 'class-variance-authority';
1
+ import { cva, type VariantProps } from 'class-variance-authority';
3
2
  import { TRANSITION_COLORS } from '../../styles/primitives';
4
3
 
4
+ // TODO: Handle visited state
5
+
5
6
  export const linkRootVariants = cva([
6
7
  'flex-row items-center gap-1',
7
8
  'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
8
- 'text-blue-600',
9
- 'underline decoration-slate-300 underline-offset-4',
10
9
  TRANSITION_COLORS,
11
- Platform.select({
12
- web: 'data-[hover=true]:decoration-slate-900',
13
- default: '',
14
- }),
15
- 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-slate-400/50 web:data-[focus-visible=true]:ring-offset-2',
10
+ 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-stroke-focus web:data-[focus-visible=true]:ring-offset-2',
11
+ ]);
12
+
13
+ export const linkLabelVariants = cva([
14
+ 'text-content-link',
15
+ 'body-md',
16
+ 'underline underline-offset-4',
16
17
  ]);
17
18
 
18
- export const linkLabelVariants = cva(['text-sm font-medium', 'text-blue-600']);
19
+ export const linkIconVariants = cva(['text-content-link', 'size-4']);
19
20
 
20
- export const linkIconVariants = cva(['size-4', 'text-blue-600']);
21
+ export type LinkVariantProps = VariantProps<typeof linkLabelVariants>;
@@ -0,0 +1,53 @@
1
+ import { forwardRef } from 'react';
2
+ import { View, type ViewProps } from 'react-native';
3
+ import { createProgress, type IProgressProps } from '@cdx-ui/primitives';
4
+ import { cn } from '@cdx-ui/utils';
5
+ import {
6
+ progressBarIndicatorVariants,
7
+ progressBarTrackVariants,
8
+ type ProgressBarTrackVariantProps,
9
+ } from './styles';
10
+
11
+ const ProgressPrimitive = createProgress({
12
+ Root: View,
13
+ Indicator: View,
14
+ });
15
+
16
+ export interface ProgressBarProps extends IProgressProps, ProgressBarTrackVariantProps {
17
+ readonly className?: string;
18
+ }
19
+
20
+ export interface ProgressBarIndicatorProps extends ViewProps {
21
+ readonly className?: string;
22
+ }
23
+
24
+ const ProgressBarRoot = forwardRef<View, ProgressBarProps>(
25
+ ({ className, style, ...props }, ref) => {
26
+ const trackClass = cn(progressBarTrackVariants(), className);
27
+
28
+ return <ProgressPrimitive ref={ref} className={trackClass} style={style} {...props} />;
29
+ },
30
+ );
31
+
32
+ ProgressBarRoot.displayName = 'ProgressBar';
33
+
34
+ const ProgressBarIndicator = forwardRef<View, ProgressBarIndicatorProps>(
35
+ ({ className, style, ...props }, ref) => (
36
+ <ProgressPrimitive.Indicator
37
+ ref={ref}
38
+ className={cn(progressBarIndicatorVariants(), className)}
39
+ style={style}
40
+ {...props}
41
+ />
42
+ ),
43
+ );
44
+
45
+ ProgressBarIndicator.displayName = 'ProgressBar.Indicator';
46
+
47
+ type ProgressBarCompoundComponent = typeof ProgressBarRoot & {
48
+ Indicator: typeof ProgressBarIndicator;
49
+ };
50
+
51
+ export const ProgressBar = Object.assign(ProgressBarRoot, {
52
+ Indicator: ProgressBarIndicator,
53
+ }) as ProgressBarCompoundComponent;
@@ -0,0 +1,9 @@
1
+ import { cva, type VariantProps } from 'class-variance-authority';
2
+
3
+ export const progressBarTrackVariants = cva([
4
+ 'w-full flex-row overflow-hidden rounded-full bg-surface-action-tint h-1',
5
+ ]);
6
+
7
+ export const progressBarIndicatorVariants = cva(['rounded-full bg-surface-action-strong']);
8
+
9
+ export type ProgressBarTrackVariantProps = VariantProps<typeof progressBarTrackVariants>;
@@ -1,13 +1,14 @@
1
1
  import { cva, type VariantProps } from 'class-variance-authority';
2
2
 
3
- export const progressSegmentedVariants = cva(['flex-row gap-1 w-full']);
3
+ export const progressSegmentedVariants = cva(['flex-row gap-1 w-full rounded overflow-hidden']);
4
4
 
5
- export const segmentVariants = cva(['flex-1 h-2 rounded'], {
5
+ export const segmentVariants = cva(['flex-1 h-1'], {
6
6
  variants: {
7
7
  state: {
8
- complete: 'bg-slate-900',
9
- incomplete: 'bg-slate-300',
10
- inprogress: 'bg-gradient-to-r from-slate-900 from-50% to-slate-300 to-50%',
8
+ complete: 'bg-surface-action-strong',
9
+ incomplete: 'bg-surface-action-tint',
10
+ inprogress:
11
+ 'bg-gradient-to-r from-surface-action-strong from-50% to-surface-action-tint to-50%',
11
12
  },
12
13
  },
13
14
  defaultVariants: {
@@ -1,10 +1,9 @@
1
1
  import { Platform } from 'react-native';
2
2
  import { cva, type VariantProps } from 'class-variance-authority';
3
- import { COLOR_TEXT_PRIMARY } from '../../styles/primitives';
4
3
 
5
4
  export const textStyle = cva(
6
5
  [
7
- `${COLOR_TEXT_PRIMARY} font-normal`,
6
+ `text-content-primary font-normal`,
8
7
  Platform.select({
9
8
  web: 'font-sans my-0 bg-transparent display-inline no-underline',
10
9
  default: '',
@@ -13,11 +12,11 @@ export const textStyle = cva(
13
12
  {
14
13
  variants: {
15
14
  size: {
16
- xl: 'text-xl',
17
- lg: 'text-lg',
18
- md: 'text-base',
19
- sm: 'text-sm',
20
- xs: 'text-xs',
15
+ xl: 'body-xl',
16
+ lg: 'body-lg',
17
+ md: 'body-md',
18
+ sm: 'body-sm',
19
+ xs: 'body-xs',
21
20
  },
22
21
  },
23
22
  },
@@ -11,6 +11,7 @@ export * from './Form';
11
11
  export * from './Image';
12
12
  export * from './Input';
13
13
  export * from './Link';
14
+ export * from './ProgressBar';
14
15
  export * from './ProgressSegmented';
15
16
  export * from './Select';
16
17
  export * from './VirtualizedList';
@@ -1,200 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.sharedOutlineGhostForegroundTextCompounds = exports.sharedGhostSurfaceCompounds = exports.sharedFilledSurfaceCompounds = exports.sharedFilledForegroundTextCompounds = void 0;
7
- var _reactNative = require("react-native");
8
- var _primitives = require("../../styles/primitives");
9
- /**
10
- * Neutral compound-variant **slices** shared by Button and IconButton (no consumer `variant` keys).
11
- *
12
- * Each consumer maps these into its own CVA, e.g. filled surface → Button `strong` or IconButton `solid`;
13
- * ghost surface / outline+ghost foreground → attach the appropriate `variant` / tuple for that component.
14
- *
15
- * Button-only outline **surface** (borders) stays in `Button/styles.ts`.
16
- */
17
-
18
- /** Root surface: filled semantic background (maps to Button `strong`, IconButton `solid`). */
19
- const sharedFilledSurfaceCompounds = exports.sharedFilledSurfaceCompounds = [{
20
- color: 'action',
21
- className: [_primitives.SEMANTIC_COLORS.action.bg, _reactNative.Platform.select({
22
- default: 'data-[active=true]:bg-slate-700',
23
- web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700'
24
- })]
25
- }, {
26
- color: 'danger',
27
- className: [_primitives.SEMANTIC_COLORS.danger.bg, _reactNative.Platform.select({
28
- default: 'data-[active=true]:bg-red-800',
29
- web: 'data-[hover=true]:bg-red-700 data-[active=true]:data-[hover=true]:bg-red-800'
30
- })]
31
- }, {
32
- color: 'warning',
33
- className: [_primitives.SEMANTIC_COLORS.warning.bg, _reactNative.Platform.select({
34
- default: 'data-[active=true]:bg-amber-700',
35
- web: 'data-[hover=true]:bg-amber-600 data-[active=true]:data-[hover=true]:bg-amber-700'
36
- })]
37
- }, {
38
- color: 'success',
39
- className: [_primitives.SEMANTIC_COLORS.success.bg, _reactNative.Platform.select({
40
- default: 'data-[active=true]:bg-green-800',
41
- web: 'data-[hover=true]:bg-green-700 data-[active=true]:data-[hover=true]:bg-green-800'
42
- })]
43
- }, {
44
- color: 'info',
45
- className: [_primitives.SEMANTIC_COLORS.info.bg, _reactNative.Platform.select({
46
- default: 'data-[active=true]:bg-sky-700',
47
- web: 'data-[hover=true]:bg-sky-600 data-[active=true]:data-[hover=true]:bg-sky-700'
48
- })]
49
- }, {
50
- color: 'action',
51
- mode: 'dark',
52
- className: ['bg-slate-200', _reactNative.Platform.select({
53
- default: 'data-[active=true]:bg-slate-400',
54
- web: 'data-[hover=true]:bg-slate-300 data-[active=true]:data-[hover=true]:bg-slate-400'
55
- })]
56
- }];
57
-
58
- /** Root surface: ghost hover/active fills (maps to `variant: 'ghost'` on Button and IconButton). */
59
- const sharedGhostSurfaceCompounds = exports.sharedGhostSurfaceCompounds = [{
60
- color: 'danger',
61
- className: [_reactNative.Platform.select({
62
- default: 'data-[active=true]:bg-red-100',
63
- web: 'data-[hover=true]:bg-red-50 data-[active=true]:data-[hover=true]:bg-red-100'
64
- })]
65
- }, {
66
- color: 'warning',
67
- className: [_reactNative.Platform.select({
68
- default: 'data-[active=true]:bg-amber-100',
69
- web: 'data-[hover=true]:bg-amber-50 data-[active=true]:data-[hover=true]:bg-amber-100'
70
- })]
71
- }, {
72
- color: 'success',
73
- className: [_reactNative.Platform.select({
74
- default: 'data-[active=true]:bg-green-100',
75
- web: 'data-[hover=true]:bg-green-50 data-[active=true]:data-[hover=true]:bg-green-100'
76
- })]
77
- }, {
78
- color: 'info',
79
- className: [_reactNative.Platform.select({
80
- default: 'data-[active=true]:bg-sky-100',
81
- web: 'data-[hover=true]:bg-sky-50 data-[active=true]:data-[hover=true]:bg-sky-100'
82
- })]
83
- }, {
84
- color: 'action',
85
- mode: 'dark',
86
- className: [_reactNative.Platform.select({
87
- default: 'data-[active=true]:bg-slate-700',
88
- web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700'
89
- })]
90
- }, {
91
- color: 'danger',
92
- mode: 'dark',
93
- className: [_reactNative.Platform.select({
94
- default: 'data-[active=true]:bg-red-950',
95
- web: 'data-[hover=true]:bg-red-950/50 data-[active=true]:data-[hover=true]:bg-red-950'
96
- })]
97
- }, {
98
- color: 'warning',
99
- mode: 'dark',
100
- className: [_reactNative.Platform.select({
101
- default: 'data-[active=true]:bg-amber-950',
102
- web: 'data-[hover=true]:bg-amber-950/50 data-[active=true]:data-[hover=true]:bg-amber-950'
103
- })]
104
- }, {
105
- color: 'success',
106
- mode: 'dark',
107
- className: [_reactNative.Platform.select({
108
- default: 'data-[active=true]:bg-green-950',
109
- web: 'data-[hover=true]:bg-green-950/50 data-[active=true]:data-[hover=true]:bg-green-950'
110
- })]
111
- }, {
112
- color: 'info',
113
- mode: 'dark',
114
- className: [_reactNative.Platform.select({
115
- default: 'data-[active=true]:bg-sky-950',
116
- web: 'data-[hover=true]:bg-sky-950/50 data-[active=true]:data-[hover=true]:bg-sky-950'
117
- })]
118
- }];
119
-
120
- /** Foreground on filled controls (maps to Button `strong`, IconButton `solid`). */
121
- const sharedFilledForegroundTextCompounds = exports.sharedFilledForegroundTextCompounds = [{
122
- color: 'action',
123
- className: 'text-white'
124
- }, {
125
- color: 'danger',
126
- className: 'text-white'
127
- }, {
128
- color: 'warning',
129
- className: 'text-white'
130
- }, {
131
- color: 'success',
132
- className: 'text-white'
133
- }, {
134
- color: 'info',
135
- className: 'text-white'
136
- }, {
137
- color: 'action',
138
- mode: 'dark',
139
- className: 'text-slate-900'
140
- }];
141
-
142
- /**
143
- * Foreground for transparent controls: same class names for Button `outline` and `ghost`, and for IconButton `ghost`.
144
- * Consumers attach their own `variant` key(s).
145
- */
146
- const sharedOutlineGhostForegroundTextCompounds = exports.sharedOutlineGhostForegroundTextCompounds = [{
147
- color: 'action',
148
- className: ['text-slate-900', _reactNative.Platform.select({
149
- default: 'data-[active=true]:text-slate-700',
150
- web: 'data-[hover=true]:text-slate-800 data-[active=true]:data-[hover=true]:text-slate-700'
151
- })]
152
- }, {
153
- color: 'danger',
154
- className: ['text-red-600', _reactNative.Platform.select({
155
- default: 'data-[active=true]:text-red-800',
156
- web: 'data-[hover=true]:text-red-700 data-[active=true]:data-[hover=true]:text-red-800'
157
- })]
158
- }, {
159
- color: 'warning',
160
- className: ['text-amber-600', _reactNative.Platform.select({
161
- default: 'data-[active=true]:text-amber-800',
162
- web: 'data-[hover=true]:text-amber-700 data-[active=true]:data-[hover=true]:text-amber-800'
163
- })]
164
- }, {
165
- color: 'success',
166
- className: ['text-green-600', _reactNative.Platform.select({
167
- default: 'data-[active=true]:text-green-800',
168
- web: 'data-[hover=true]:text-green-700 data-[active=true]:data-[hover=true]:text-green-800'
169
- })]
170
- }, {
171
- color: 'info',
172
- className: ['text-sky-600', _reactNative.Platform.select({
173
- default: 'data-[active=true]:text-sky-800',
174
- web: 'data-[hover=true]:text-sky-700 data-[active=true]:data-[hover=true]:text-sky-800'
175
- })]
176
- }, {
177
- color: 'action',
178
- mode: 'dark',
179
- className: ['text-white', _reactNative.Platform.select({
180
- default: 'data-[active=true]:text-white',
181
- web: 'data-[hover=true]:text-white data-[active=true]:data-[hover=true]:text-white'
182
- })]
183
- }, {
184
- color: 'danger',
185
- mode: 'dark',
186
- className: 'text-red-400'
187
- }, {
188
- color: 'warning',
189
- mode: 'dark',
190
- className: 'text-amber-400'
191
- }, {
192
- color: 'success',
193
- mode: 'dark',
194
- className: 'text-green-400'
195
- }, {
196
- color: 'info',
197
- mode: 'dark',
198
- className: 'text-sky-400'
199
- }];
200
- //# sourceMappingURL=buttonSharedVariants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_primitives","sharedFilledSurfaceCompounds","exports","color","className","SEMANTIC_COLORS","action","bg","Platform","select","default","web","danger","warning","success","info","mode","sharedGhostSurfaceCompounds","sharedFilledForegroundTextCompounds","sharedOutlineGhostForegroundTextCompounds"],"sourceRoot":"../../../../src","sources":["components/Button/buttonSharedVariants.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AATA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACO,MAAME,4BAIV,GAAAC,OAAA,CAAAD,4BAAA,GAAG,CACJ;EACEE,KAAK,EAAE,QAAQ;EACfC,SAAS,EAAE,CACTC,2BAAe,CAACC,MAAM,CAACC,EAAE,EACzBC,qBAAQ,CAACC,MAAM,CAAC;IACdC,OAAO,EAAE,iCAAiC;IAC1CC,GAAG,EAAE;EACP,CAAC,CAAC;AAEN,CAAC,EACD;EACER,KAAK,EAAE,QAAQ;EACfC,SAAS,EAAE,CACTC,2BAAe,CAACO,MAAM,CAACL,EAAE,EACzBC,qBAAQ,CAACC,MAAM,CAAC;IACdC,OAAO,EAAE,+BAA+B;IACxCC,GAAG,EAAE;EACP,CAAC,CAAC;AAEN,CAAC,EACD;EACER,KAAK,EAAE,SAAS;EAChBC,SAAS,EAAE,CACTC,2BAAe,CAACQ,OAAO,CAACN,EAAE,EAC1BC,qBAAQ,CAACC,MAAM,CAAC;IACdC,OAAO,EAAE,iCAAiC;IAC1CC,GAAG,EAAE;EACP,CAAC,CAAC;AAEN,CAAC,EACD;EACER,KAAK,EAAE,SAAS;EAChBC,SAAS,EAAE,CACTC,2BAAe,CAACS,OAAO,CAACP,EAAE,EAC1BC,qBAAQ,CAACC,MAAM,CAAC;IACdC,OAAO,EAAE,iCAAiC;IAC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,EAAE,SAAS;EAChBa,IAAI,EAAE,MAAM;EACZZ,SAAS,EAAE;AACb,CAAC,EACD;EACED,KAAK,EAAE,SAAS;EAChBa,IAAI,EAAE,MAAM;EACZZ,SAAS,EAAE;AACb,CAAC,EACD;EACED,KAAK,EAAE,MAAM;EACba,IAAI,EAAE,MAAM;EACZZ,SAAS,EAAE;AACb,CAAC,CACF","ignoreList":[]}
@@ -1,195 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Neutral compound-variant **slices** shared by Button and IconButton (no consumer `variant` keys).
5
- *
6
- * Each consumer maps these into its own CVA, e.g. filled surface → Button `strong` or IconButton `solid`;
7
- * ghost surface / outline+ghost foreground → attach the appropriate `variant` / tuple for that component.
8
- *
9
- * Button-only outline **surface** (borders) stays in `Button/styles.ts`.
10
- */
11
- import { Platform } from 'react-native';
12
- import { SEMANTIC_COLORS } from '../../styles/primitives';
13
- /** Root surface: filled semantic background (maps to Button `strong`, IconButton `solid`). */
14
- export const sharedFilledSurfaceCompounds = [{
15
- color: 'action',
16
- className: [SEMANTIC_COLORS.action.bg, Platform.select({
17
- default: 'data-[active=true]:bg-slate-700',
18
- web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700'
19
- })]
20
- }, {
21
- color: 'danger',
22
- className: [SEMANTIC_COLORS.danger.bg, Platform.select({
23
- default: 'data-[active=true]:bg-red-800',
24
- web: 'data-[hover=true]:bg-red-700 data-[active=true]:data-[hover=true]:bg-red-800'
25
- })]
26
- }, {
27
- color: 'warning',
28
- className: [SEMANTIC_COLORS.warning.bg, Platform.select({
29
- default: 'data-[active=true]:bg-amber-700',
30
- web: 'data-[hover=true]:bg-amber-600 data-[active=true]:data-[hover=true]:bg-amber-700'
31
- })]
32
- }, {
33
- color: 'success',
34
- className: [SEMANTIC_COLORS.success.bg, Platform.select({
35
- default: 'data-[active=true]:bg-green-800',
36
- web: 'data-[hover=true]:bg-green-700 data-[active=true]:data-[hover=true]:bg-green-800'
37
- })]
38
- }, {
39
- color: 'info',
40
- className: [SEMANTIC_COLORS.info.bg, Platform.select({
41
- default: 'data-[active=true]:bg-sky-700',
42
- web: 'data-[hover=true]:bg-sky-600 data-[active=true]:data-[hover=true]:bg-sky-700'
43
- })]
44
- }, {
45
- color: 'action',
46
- mode: 'dark',
47
- className: ['bg-slate-200', Platform.select({
48
- default: 'data-[active=true]:bg-slate-400',
49
- web: 'data-[hover=true]:bg-slate-300 data-[active=true]:data-[hover=true]:bg-slate-400'
50
- })]
51
- }];
52
-
53
- /** Root surface: ghost hover/active fills (maps to `variant: 'ghost'` on Button and IconButton). */
54
- export const sharedGhostSurfaceCompounds = [{
55
- color: 'danger',
56
- className: [Platform.select({
57
- default: 'data-[active=true]:bg-red-100',
58
- web: 'data-[hover=true]:bg-red-50 data-[active=true]:data-[hover=true]:bg-red-100'
59
- })]
60
- }, {
61
- color: 'warning',
62
- className: [Platform.select({
63
- default: 'data-[active=true]:bg-amber-100',
64
- web: 'data-[hover=true]:bg-amber-50 data-[active=true]:data-[hover=true]:bg-amber-100'
65
- })]
66
- }, {
67
- color: 'success',
68
- className: [Platform.select({
69
- default: 'data-[active=true]:bg-green-100',
70
- web: 'data-[hover=true]:bg-green-50 data-[active=true]:data-[hover=true]:bg-green-100'
71
- })]
72
- }, {
73
- color: 'info',
74
- className: [Platform.select({
75
- default: 'data-[active=true]:bg-sky-100',
76
- web: 'data-[hover=true]:bg-sky-50 data-[active=true]:data-[hover=true]:bg-sky-100'
77
- })]
78
- }, {
79
- color: 'action',
80
- mode: 'dark',
81
- className: [Platform.select({
82
- default: 'data-[active=true]:bg-slate-700',
83
- web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700'
84
- })]
85
- }, {
86
- color: 'danger',
87
- mode: 'dark',
88
- className: [Platform.select({
89
- default: 'data-[active=true]:bg-red-950',
90
- web: 'data-[hover=true]:bg-red-950/50 data-[active=true]:data-[hover=true]:bg-red-950'
91
- })]
92
- }, {
93
- color: 'warning',
94
- mode: 'dark',
95
- className: [Platform.select({
96
- default: 'data-[active=true]:bg-amber-950',
97
- web: 'data-[hover=true]:bg-amber-950/50 data-[active=true]:data-[hover=true]:bg-amber-950'
98
- })]
99
- }, {
100
- color: 'success',
101
- mode: 'dark',
102
- className: [Platform.select({
103
- default: 'data-[active=true]:bg-green-950',
104
- web: 'data-[hover=true]:bg-green-950/50 data-[active=true]:data-[hover=true]:bg-green-950'
105
- })]
106
- }, {
107
- color: 'info',
108
- mode: 'dark',
109
- className: [Platform.select({
110
- default: 'data-[active=true]:bg-sky-950',
111
- web: 'data-[hover=true]:bg-sky-950/50 data-[active=true]:data-[hover=true]:bg-sky-950'
112
- })]
113
- }];
114
-
115
- /** Foreground on filled controls (maps to Button `strong`, IconButton `solid`). */
116
- export const sharedFilledForegroundTextCompounds = [{
117
- color: 'action',
118
- className: 'text-white'
119
- }, {
120
- color: 'danger',
121
- className: 'text-white'
122
- }, {
123
- color: 'warning',
124
- className: 'text-white'
125
- }, {
126
- color: 'success',
127
- className: 'text-white'
128
- }, {
129
- color: 'info',
130
- className: 'text-white'
131
- }, {
132
- color: 'action',
133
- mode: 'dark',
134
- className: 'text-slate-900'
135
- }];
136
-
137
- /**
138
- * Foreground for transparent controls: same class names for Button `outline` and `ghost`, and for IconButton `ghost`.
139
- * Consumers attach their own `variant` key(s).
140
- */
141
- export const sharedOutlineGhostForegroundTextCompounds = [{
142
- color: 'action',
143
- className: ['text-slate-900', Platform.select({
144
- default: 'data-[active=true]:text-slate-700',
145
- web: 'data-[hover=true]:text-slate-800 data-[active=true]:data-[hover=true]:text-slate-700'
146
- })]
147
- }, {
148
- color: 'danger',
149
- className: ['text-red-600', Platform.select({
150
- default: 'data-[active=true]:text-red-800',
151
- web: 'data-[hover=true]:text-red-700 data-[active=true]:data-[hover=true]:text-red-800'
152
- })]
153
- }, {
154
- color: 'warning',
155
- className: ['text-amber-600', Platform.select({
156
- default: 'data-[active=true]:text-amber-800',
157
- web: 'data-[hover=true]:text-amber-700 data-[active=true]:data-[hover=true]:text-amber-800'
158
- })]
159
- }, {
160
- color: 'success',
161
- className: ['text-green-600', Platform.select({
162
- default: 'data-[active=true]:text-green-800',
163
- web: 'data-[hover=true]:text-green-700 data-[active=true]:data-[hover=true]:text-green-800'
164
- })]
165
- }, {
166
- color: 'info',
167
- className: ['text-sky-600', Platform.select({
168
- default: 'data-[active=true]:text-sky-800',
169
- web: 'data-[hover=true]:text-sky-700 data-[active=true]:data-[hover=true]:text-sky-800'
170
- })]
171
- }, {
172
- color: 'action',
173
- mode: 'dark',
174
- className: ['text-white', Platform.select({
175
- default: 'data-[active=true]:text-white',
176
- web: 'data-[hover=true]:text-white data-[active=true]:data-[hover=true]:text-white'
177
- })]
178
- }, {
179
- color: 'danger',
180
- mode: 'dark',
181
- className: 'text-red-400'
182
- }, {
183
- color: 'warning',
184
- mode: 'dark',
185
- className: 'text-amber-400'
186
- }, {
187
- color: 'success',
188
- mode: 'dark',
189
- className: 'text-green-400'
190
- }, {
191
- color: 'info',
192
- mode: 'dark',
193
- className: 'text-sky-400'
194
- }];
195
- //# sourceMappingURL=buttonSharedVariants.js.map