@splenddev/kreativ-ui 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +731 -33
- package/dist/index.cjs +24 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +200 -5
- package/dist/index.d.ts +200 -5
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { CSSProperties, ReactNode, ButtonHTMLAttributes,
|
|
2
|
+
import { CSSProperties, ReactNode, ButtonHTMLAttributes, ReactElement, InputHTMLAttributes, HTMLAttributes, TextareaHTMLAttributes, RefObject, JSX } from 'react';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
5
5
|
type Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
@@ -122,17 +122,42 @@ type ButtonVariant = BaseVariant | "link";
|
|
|
122
122
|
type ButtonColor = BaseColor;
|
|
123
123
|
interface ButtonRenderProps {
|
|
124
124
|
className?: string;
|
|
125
|
-
style?:
|
|
125
|
+
style?: CSSProperties;
|
|
126
126
|
disabled?: boolean;
|
|
127
|
+
"aria-disabled"?: boolean;
|
|
127
128
|
"aria-busy"?: boolean;
|
|
128
|
-
children?:
|
|
129
|
+
children?: ReactNode;
|
|
129
130
|
}
|
|
130
131
|
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps, TypographyProps {
|
|
131
132
|
size?: ButtonSize;
|
|
132
133
|
leftIcon?: ReactNode;
|
|
133
134
|
rightIcon?: ReactNode;
|
|
134
135
|
iconOnly?: boolean;
|
|
135
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Custom rendering escape hatch.
|
|
138
|
+
*
|
|
139
|
+
* Receives the resolved Button props and allows the consumer
|
|
140
|
+
* to render the Button using another element or component.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```tsx
|
|
144
|
+
* <Button
|
|
145
|
+
* render={(props) => (
|
|
146
|
+
* <a {...props} href="/templates">
|
|
147
|
+
* Templates
|
|
148
|
+
* </a>
|
|
149
|
+
* )}
|
|
150
|
+
* >
|
|
151
|
+
* Templates
|
|
152
|
+
* </Button>
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* @remarks
|
|
156
|
+
* The render function must be created inside a Client Component
|
|
157
|
+
* when using Next.js App Router. Functions cannot be passed from
|
|
158
|
+
* Server Components to Client Components.
|
|
159
|
+
*/
|
|
160
|
+
render?: (props: ButtonRenderProps) => ReactElement;
|
|
136
161
|
}
|
|
137
162
|
|
|
138
163
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1299,4 +1324,174 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1299
1324
|
declare function rgbToHex(value: string): string;
|
|
1300
1325
|
declare function hexToRgbString(hex: string): string | null;
|
|
1301
1326
|
|
|
1302
|
-
|
|
1327
|
+
declare const buttonBase: string;
|
|
1328
|
+
declare const buttonVariants: {
|
|
1329
|
+
readonly solid: "";
|
|
1330
|
+
readonly outline: "border bg-transparent";
|
|
1331
|
+
readonly ghost: "bg-transparent";
|
|
1332
|
+
readonly soft: "";
|
|
1333
|
+
readonly link: "bg-transparent p-0 h-auto hover:underline";
|
|
1334
|
+
};
|
|
1335
|
+
declare const buttonColors: {
|
|
1336
|
+
readonly brand: {
|
|
1337
|
+
readonly solid: "bg-brand text-brand-fg hover:bg-brand-hover";
|
|
1338
|
+
readonly outline: "border-brand text-brand hover:bg-brand/10";
|
|
1339
|
+
readonly ghost: "text-brand hover:bg-brand/10";
|
|
1340
|
+
readonly soft: "bg-brand/10 text-brand hover:bg-brand/20";
|
|
1341
|
+
readonly link: "text-brand";
|
|
1342
|
+
};
|
|
1343
|
+
readonly destructive: {
|
|
1344
|
+
readonly solid: "bg-destructive text-destructive-fg hover:bg-destructive-hover";
|
|
1345
|
+
readonly outline: "border-destructive text-destructive hover:bg-destructive/10";
|
|
1346
|
+
readonly ghost: "text-destructive hover:bg-destructive/10";
|
|
1347
|
+
readonly soft: "bg-destructive/10 text-destructive hover:bg-destructive/20";
|
|
1348
|
+
readonly link: "text-destructive";
|
|
1349
|
+
};
|
|
1350
|
+
readonly success: {
|
|
1351
|
+
readonly solid: "bg-success text-success-fg hover:bg-success-hover";
|
|
1352
|
+
readonly outline: "border-success text-success hover:bg-success/10";
|
|
1353
|
+
readonly ghost: "text-success hover:bg-success/10";
|
|
1354
|
+
readonly soft: "bg-success/10 text-success hover:bg-success/20";
|
|
1355
|
+
readonly link: "text-success";
|
|
1356
|
+
};
|
|
1357
|
+
readonly warning: {
|
|
1358
|
+
readonly solid: "bg-warning text-warning-fg hover:bg-warning-hover";
|
|
1359
|
+
readonly outline: "border-warning text-warning hover:bg-warning/10";
|
|
1360
|
+
readonly ghost: "text-warning hover:bg-warning/10";
|
|
1361
|
+
readonly soft: "bg-warning/10 text-warning hover:bg-warning/20";
|
|
1362
|
+
readonly link: "text-warning";
|
|
1363
|
+
};
|
|
1364
|
+
readonly info: {
|
|
1365
|
+
readonly solid: "bg-info text-info-fg hover:bg-info-hover";
|
|
1366
|
+
readonly outline: "border-info text-info hover:bg-info/10";
|
|
1367
|
+
readonly ghost: "text-info hover:bg-info/10";
|
|
1368
|
+
readonly soft: "bg-info/10 text-info hover:bg-info/20";
|
|
1369
|
+
readonly link: "text-info";
|
|
1370
|
+
};
|
|
1371
|
+
readonly white: {
|
|
1372
|
+
readonly solid: "bg-white text-black hover:bg-gray-50";
|
|
1373
|
+
readonly outline: "border-white/30 text-white hover:bg-white/10";
|
|
1374
|
+
readonly ghost: "text-white hover:bg-white/10";
|
|
1375
|
+
readonly soft: "bg-white/10 text-white hover:bg-white/20";
|
|
1376
|
+
readonly link: "text-white";
|
|
1377
|
+
};
|
|
1378
|
+
readonly neutral: {
|
|
1379
|
+
readonly solid: "bg-surface-raised text-text hover:bg-surface-sunken";
|
|
1380
|
+
readonly outline: "border-border text-text hover:bg-surface-raised";
|
|
1381
|
+
readonly ghost: "text-text hover:bg-surface-raised";
|
|
1382
|
+
readonly soft: "bg-surface-raised text-text hover:bg-surface-sunken";
|
|
1383
|
+
readonly link: "text-text";
|
|
1384
|
+
};
|
|
1385
|
+
};
|
|
1386
|
+
declare const buttonRecipe: {
|
|
1387
|
+
base: string;
|
|
1388
|
+
variants: {
|
|
1389
|
+
variant: {
|
|
1390
|
+
readonly solid: "";
|
|
1391
|
+
readonly outline: "border bg-transparent";
|
|
1392
|
+
readonly ghost: "bg-transparent";
|
|
1393
|
+
readonly soft: "";
|
|
1394
|
+
readonly link: "bg-transparent p-0 h-auto hover:underline";
|
|
1395
|
+
};
|
|
1396
|
+
color: Record<string, string>;
|
|
1397
|
+
};
|
|
1398
|
+
defaultVariants: {
|
|
1399
|
+
variant: string;
|
|
1400
|
+
color: string;
|
|
1401
|
+
};
|
|
1402
|
+
compoundVariants: {
|
|
1403
|
+
conditions: Record<string, string>;
|
|
1404
|
+
className: string;
|
|
1405
|
+
}[];
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
declare const inputBase: string;
|
|
1409
|
+
declare const inputRecipe: {
|
|
1410
|
+
base: string;
|
|
1411
|
+
variants: {
|
|
1412
|
+
variant: {
|
|
1413
|
+
outline: string;
|
|
1414
|
+
filled: string;
|
|
1415
|
+
ghost: string;
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
defaultVariants: {
|
|
1419
|
+
variant: string;
|
|
1420
|
+
};
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
declare const formControlBase: string;
|
|
1424
|
+
declare const formControlVariants: {
|
|
1425
|
+
readonly outline: "border border-border bg-transparent text-text hover:border-brand";
|
|
1426
|
+
readonly filled: "border border-transparent bg-surface-raised text-text hover:bg-surface";
|
|
1427
|
+
readonly ghost: "border border-transparent bg-transparent text-text hover:bg-surface-raised";
|
|
1428
|
+
};
|
|
1429
|
+
declare const formControlStates: {
|
|
1430
|
+
readonly none: "focus-within:ring-brand/20";
|
|
1431
|
+
readonly error: "border-destructive focus-within:ring-destructive/20";
|
|
1432
|
+
readonly success: "border-success focus-within:ring-success/20";
|
|
1433
|
+
};
|
|
1434
|
+
declare const formControlRecipe: {
|
|
1435
|
+
base: string;
|
|
1436
|
+
variants: {
|
|
1437
|
+
variant: {
|
|
1438
|
+
readonly outline: "border border-border bg-transparent text-text hover:border-brand";
|
|
1439
|
+
readonly filled: "border border-transparent bg-surface-raised text-text hover:bg-surface";
|
|
1440
|
+
readonly ghost: "border border-transparent bg-transparent text-text hover:bg-surface-raised";
|
|
1441
|
+
};
|
|
1442
|
+
state: {
|
|
1443
|
+
readonly none: "focus-within:ring-brand/20";
|
|
1444
|
+
readonly error: "border-destructive focus-within:ring-destructive/20";
|
|
1445
|
+
readonly success: "border-success focus-within:ring-success/20";
|
|
1446
|
+
};
|
|
1447
|
+
rounded: {
|
|
1448
|
+
true: string;
|
|
1449
|
+
false: string;
|
|
1450
|
+
};
|
|
1451
|
+
fullWidth: {
|
|
1452
|
+
true: string;
|
|
1453
|
+
false: string;
|
|
1454
|
+
};
|
|
1455
|
+
disabled: {
|
|
1456
|
+
true: string;
|
|
1457
|
+
false: string;
|
|
1458
|
+
};
|
|
1459
|
+
hasAdornment: {
|
|
1460
|
+
true: string;
|
|
1461
|
+
false: string;
|
|
1462
|
+
};
|
|
1463
|
+
};
|
|
1464
|
+
defaultVariants: {
|
|
1465
|
+
variant: string;
|
|
1466
|
+
state: string;
|
|
1467
|
+
rounded: false;
|
|
1468
|
+
fullWidth: true;
|
|
1469
|
+
disabled: false;
|
|
1470
|
+
hasAdornment: false;
|
|
1471
|
+
};
|
|
1472
|
+
};
|
|
1473
|
+
|
|
1474
|
+
declare function defineRecipe<T extends RecipeDefinition>(recipe: T): T;
|
|
1475
|
+
|
|
1476
|
+
declare function mergeRecipes(base: RecipeCollection, override?: ThemeOverride["recipes"]): RecipeCollection;
|
|
1477
|
+
|
|
1478
|
+
interface RecipeProps {
|
|
1479
|
+
[key: string]: RecipeVariantValue | undefined;
|
|
1480
|
+
}
|
|
1481
|
+
declare function resolveRecipe(recipe: RecipeDefinition | undefined, props?: RecipeProps): string;
|
|
1482
|
+
|
|
1483
|
+
declare function resolveTypography(typography: TypographyStyle | undefined, tokens: DesignTokens): CSSProperties;
|
|
1484
|
+
|
|
1485
|
+
declare function defineTypography(typography: TypographyStyle): TypographyStyle;
|
|
1486
|
+
|
|
1487
|
+
declare function defineToken<T>(value: T): {
|
|
1488
|
+
value: T;
|
|
1489
|
+
};
|
|
1490
|
+
declare function defineSemanticToken<T>(light: T, dark: T): {
|
|
1491
|
+
value: {
|
|
1492
|
+
light: T;
|
|
1493
|
+
dark: T;
|
|
1494
|
+
};
|
|
1495
|
+
};
|
|
1496
|
+
|
|
1497
|
+
export { type AnimationTokens, type BaseColor, type BaseProps, type BaseTransition, type BaseVariant, Button, type ButtonProps, type CSSPropertiesWithVars, Checkbox, type CheckboxProps, type ClearableProps, type ColorMode, type ColorModeValue, type ColorProps, type ColorScale, type ColorTokens, Combobox, ComboboxContent, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, type ComboboxProps, type DeepPartial, type DesignTokens, type DisabledProps, type FontSizeTokens, type FontTokens, type FontWeightTokens, FormField, FormFieldControl, FormFieldDescription, FormFieldLabel, FormFieldMessage, type FormFieldProps, type FullWidthProps, Input, type InputKind, type InputKindDefaults, type InputProps, type InputSize, type InputVariant, type IntensityMap, type LetterSpacingTokens, type LineHeightTokens, type LoadingProps, MarkdownEditor, type MarkdownEditorProps, type MarkdownEditorTabs, MultiSelect, MultiSelectContent, MultiSelectContext, type MultiSelectContextValue, MultiSelectItem, type MultiSelectItemMeta, type MultiSelectItemProps, type MultiSelectProps, MultiSelectTrigger, type Orientation, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadioSize, type RadiusTokens, type RecipeCollection, type RecipeCompoundVariant, type RecipeDefinition, type RecipeProps, type RecipeStyle, type RecipeVariant, type RecipeVariantValue, type ResolvedSize, type ResolvedTokens, Select, SelectContent, type SelectContentProps, SelectContext, type SelectContextValue, SelectGroup, SelectGroupContext, type SelectGroupProps, SelectItem, type SelectItemMeta, type SelectItemProps, type SelectLabelProps, type SelectProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SemanticColorTokens, type SemanticToken, type SemanticTokens, type ShadowTokens, type Size, type SizeProps, type SizeScale, type SizeToken, type SizeValue, type SpacingTokens, type StateProps, type Styleable, Switch, type SwitchProps, Textarea, TextareaCore, type TextareaCoreProps, type TextareaProps, type TextareaResize, type Theme, ThemeContext, type ThemeContextValue, type ThemeOverride, ThemeToggler, type ThemeTogglerColor, type ThemeTogglerDisplay, type ThemeTogglerProps, type ThemeTogglerVariant, type ThemeTransition, type TokenDefinition, type TokenGroup, type TokenValue, type Typography, type TypographyProps, type TypographyStyle, UIProvider, type UIProviderProps, type UseSizeStyleOptions, type ValueProps, type Variant, type VariantProps, buttonBase, buttonColors, buttonRecipe, buttonVariants, cn, defaultRecipes, defaultSizes, defaultTheme, defineRecipe, defineSemanticToken, defineToken, defineTypography, formControlBase, formControlRecipe, formControlStates, formControlVariants, hexToRgbString, inputBase, inputKindDefaults, inputRecipe, mergeRecipes, resolveRecipe, resolveTypography, rgbToHex, tokensToCssVars, useBreakpoint, useFloatingSide, useMultiSelectContext, useSelectContext, useSizeStyle, useStateTransition, useTheme, useTypography };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { CSSProperties, ReactNode, ButtonHTMLAttributes,
|
|
2
|
+
import { CSSProperties, ReactNode, ButtonHTMLAttributes, ReactElement, InputHTMLAttributes, HTMLAttributes, TextareaHTMLAttributes, RefObject, JSX } from 'react';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
5
5
|
type Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
@@ -122,17 +122,42 @@ type ButtonVariant = BaseVariant | "link";
|
|
|
122
122
|
type ButtonColor = BaseColor;
|
|
123
123
|
interface ButtonRenderProps {
|
|
124
124
|
className?: string;
|
|
125
|
-
style?:
|
|
125
|
+
style?: CSSProperties;
|
|
126
126
|
disabled?: boolean;
|
|
127
|
+
"aria-disabled"?: boolean;
|
|
127
128
|
"aria-busy"?: boolean;
|
|
128
|
-
children?:
|
|
129
|
+
children?: ReactNode;
|
|
129
130
|
}
|
|
130
131
|
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps, TypographyProps {
|
|
131
132
|
size?: ButtonSize;
|
|
132
133
|
leftIcon?: ReactNode;
|
|
133
134
|
rightIcon?: ReactNode;
|
|
134
135
|
iconOnly?: boolean;
|
|
135
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Custom rendering escape hatch.
|
|
138
|
+
*
|
|
139
|
+
* Receives the resolved Button props and allows the consumer
|
|
140
|
+
* to render the Button using another element or component.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```tsx
|
|
144
|
+
* <Button
|
|
145
|
+
* render={(props) => (
|
|
146
|
+
* <a {...props} href="/templates">
|
|
147
|
+
* Templates
|
|
148
|
+
* </a>
|
|
149
|
+
* )}
|
|
150
|
+
* >
|
|
151
|
+
* Templates
|
|
152
|
+
* </Button>
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* @remarks
|
|
156
|
+
* The render function must be created inside a Client Component
|
|
157
|
+
* when using Next.js App Router. Functions cannot be passed from
|
|
158
|
+
* Server Components to Client Components.
|
|
159
|
+
*/
|
|
160
|
+
render?: (props: ButtonRenderProps) => ReactElement;
|
|
136
161
|
}
|
|
137
162
|
|
|
138
163
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1299,4 +1324,174 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1299
1324
|
declare function rgbToHex(value: string): string;
|
|
1300
1325
|
declare function hexToRgbString(hex: string): string | null;
|
|
1301
1326
|
|
|
1302
|
-
|
|
1327
|
+
declare const buttonBase: string;
|
|
1328
|
+
declare const buttonVariants: {
|
|
1329
|
+
readonly solid: "";
|
|
1330
|
+
readonly outline: "border bg-transparent";
|
|
1331
|
+
readonly ghost: "bg-transparent";
|
|
1332
|
+
readonly soft: "";
|
|
1333
|
+
readonly link: "bg-transparent p-0 h-auto hover:underline";
|
|
1334
|
+
};
|
|
1335
|
+
declare const buttonColors: {
|
|
1336
|
+
readonly brand: {
|
|
1337
|
+
readonly solid: "bg-brand text-brand-fg hover:bg-brand-hover";
|
|
1338
|
+
readonly outline: "border-brand text-brand hover:bg-brand/10";
|
|
1339
|
+
readonly ghost: "text-brand hover:bg-brand/10";
|
|
1340
|
+
readonly soft: "bg-brand/10 text-brand hover:bg-brand/20";
|
|
1341
|
+
readonly link: "text-brand";
|
|
1342
|
+
};
|
|
1343
|
+
readonly destructive: {
|
|
1344
|
+
readonly solid: "bg-destructive text-destructive-fg hover:bg-destructive-hover";
|
|
1345
|
+
readonly outline: "border-destructive text-destructive hover:bg-destructive/10";
|
|
1346
|
+
readonly ghost: "text-destructive hover:bg-destructive/10";
|
|
1347
|
+
readonly soft: "bg-destructive/10 text-destructive hover:bg-destructive/20";
|
|
1348
|
+
readonly link: "text-destructive";
|
|
1349
|
+
};
|
|
1350
|
+
readonly success: {
|
|
1351
|
+
readonly solid: "bg-success text-success-fg hover:bg-success-hover";
|
|
1352
|
+
readonly outline: "border-success text-success hover:bg-success/10";
|
|
1353
|
+
readonly ghost: "text-success hover:bg-success/10";
|
|
1354
|
+
readonly soft: "bg-success/10 text-success hover:bg-success/20";
|
|
1355
|
+
readonly link: "text-success";
|
|
1356
|
+
};
|
|
1357
|
+
readonly warning: {
|
|
1358
|
+
readonly solid: "bg-warning text-warning-fg hover:bg-warning-hover";
|
|
1359
|
+
readonly outline: "border-warning text-warning hover:bg-warning/10";
|
|
1360
|
+
readonly ghost: "text-warning hover:bg-warning/10";
|
|
1361
|
+
readonly soft: "bg-warning/10 text-warning hover:bg-warning/20";
|
|
1362
|
+
readonly link: "text-warning";
|
|
1363
|
+
};
|
|
1364
|
+
readonly info: {
|
|
1365
|
+
readonly solid: "bg-info text-info-fg hover:bg-info-hover";
|
|
1366
|
+
readonly outline: "border-info text-info hover:bg-info/10";
|
|
1367
|
+
readonly ghost: "text-info hover:bg-info/10";
|
|
1368
|
+
readonly soft: "bg-info/10 text-info hover:bg-info/20";
|
|
1369
|
+
readonly link: "text-info";
|
|
1370
|
+
};
|
|
1371
|
+
readonly white: {
|
|
1372
|
+
readonly solid: "bg-white text-black hover:bg-gray-50";
|
|
1373
|
+
readonly outline: "border-white/30 text-white hover:bg-white/10";
|
|
1374
|
+
readonly ghost: "text-white hover:bg-white/10";
|
|
1375
|
+
readonly soft: "bg-white/10 text-white hover:bg-white/20";
|
|
1376
|
+
readonly link: "text-white";
|
|
1377
|
+
};
|
|
1378
|
+
readonly neutral: {
|
|
1379
|
+
readonly solid: "bg-surface-raised text-text hover:bg-surface-sunken";
|
|
1380
|
+
readonly outline: "border-border text-text hover:bg-surface-raised";
|
|
1381
|
+
readonly ghost: "text-text hover:bg-surface-raised";
|
|
1382
|
+
readonly soft: "bg-surface-raised text-text hover:bg-surface-sunken";
|
|
1383
|
+
readonly link: "text-text";
|
|
1384
|
+
};
|
|
1385
|
+
};
|
|
1386
|
+
declare const buttonRecipe: {
|
|
1387
|
+
base: string;
|
|
1388
|
+
variants: {
|
|
1389
|
+
variant: {
|
|
1390
|
+
readonly solid: "";
|
|
1391
|
+
readonly outline: "border bg-transparent";
|
|
1392
|
+
readonly ghost: "bg-transparent";
|
|
1393
|
+
readonly soft: "";
|
|
1394
|
+
readonly link: "bg-transparent p-0 h-auto hover:underline";
|
|
1395
|
+
};
|
|
1396
|
+
color: Record<string, string>;
|
|
1397
|
+
};
|
|
1398
|
+
defaultVariants: {
|
|
1399
|
+
variant: string;
|
|
1400
|
+
color: string;
|
|
1401
|
+
};
|
|
1402
|
+
compoundVariants: {
|
|
1403
|
+
conditions: Record<string, string>;
|
|
1404
|
+
className: string;
|
|
1405
|
+
}[];
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
declare const inputBase: string;
|
|
1409
|
+
declare const inputRecipe: {
|
|
1410
|
+
base: string;
|
|
1411
|
+
variants: {
|
|
1412
|
+
variant: {
|
|
1413
|
+
outline: string;
|
|
1414
|
+
filled: string;
|
|
1415
|
+
ghost: string;
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
defaultVariants: {
|
|
1419
|
+
variant: string;
|
|
1420
|
+
};
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
declare const formControlBase: string;
|
|
1424
|
+
declare const formControlVariants: {
|
|
1425
|
+
readonly outline: "border border-border bg-transparent text-text hover:border-brand";
|
|
1426
|
+
readonly filled: "border border-transparent bg-surface-raised text-text hover:bg-surface";
|
|
1427
|
+
readonly ghost: "border border-transparent bg-transparent text-text hover:bg-surface-raised";
|
|
1428
|
+
};
|
|
1429
|
+
declare const formControlStates: {
|
|
1430
|
+
readonly none: "focus-within:ring-brand/20";
|
|
1431
|
+
readonly error: "border-destructive focus-within:ring-destructive/20";
|
|
1432
|
+
readonly success: "border-success focus-within:ring-success/20";
|
|
1433
|
+
};
|
|
1434
|
+
declare const formControlRecipe: {
|
|
1435
|
+
base: string;
|
|
1436
|
+
variants: {
|
|
1437
|
+
variant: {
|
|
1438
|
+
readonly outline: "border border-border bg-transparent text-text hover:border-brand";
|
|
1439
|
+
readonly filled: "border border-transparent bg-surface-raised text-text hover:bg-surface";
|
|
1440
|
+
readonly ghost: "border border-transparent bg-transparent text-text hover:bg-surface-raised";
|
|
1441
|
+
};
|
|
1442
|
+
state: {
|
|
1443
|
+
readonly none: "focus-within:ring-brand/20";
|
|
1444
|
+
readonly error: "border-destructive focus-within:ring-destructive/20";
|
|
1445
|
+
readonly success: "border-success focus-within:ring-success/20";
|
|
1446
|
+
};
|
|
1447
|
+
rounded: {
|
|
1448
|
+
true: string;
|
|
1449
|
+
false: string;
|
|
1450
|
+
};
|
|
1451
|
+
fullWidth: {
|
|
1452
|
+
true: string;
|
|
1453
|
+
false: string;
|
|
1454
|
+
};
|
|
1455
|
+
disabled: {
|
|
1456
|
+
true: string;
|
|
1457
|
+
false: string;
|
|
1458
|
+
};
|
|
1459
|
+
hasAdornment: {
|
|
1460
|
+
true: string;
|
|
1461
|
+
false: string;
|
|
1462
|
+
};
|
|
1463
|
+
};
|
|
1464
|
+
defaultVariants: {
|
|
1465
|
+
variant: string;
|
|
1466
|
+
state: string;
|
|
1467
|
+
rounded: false;
|
|
1468
|
+
fullWidth: true;
|
|
1469
|
+
disabled: false;
|
|
1470
|
+
hasAdornment: false;
|
|
1471
|
+
};
|
|
1472
|
+
};
|
|
1473
|
+
|
|
1474
|
+
declare function defineRecipe<T extends RecipeDefinition>(recipe: T): T;
|
|
1475
|
+
|
|
1476
|
+
declare function mergeRecipes(base: RecipeCollection, override?: ThemeOverride["recipes"]): RecipeCollection;
|
|
1477
|
+
|
|
1478
|
+
interface RecipeProps {
|
|
1479
|
+
[key: string]: RecipeVariantValue | undefined;
|
|
1480
|
+
}
|
|
1481
|
+
declare function resolveRecipe(recipe: RecipeDefinition | undefined, props?: RecipeProps): string;
|
|
1482
|
+
|
|
1483
|
+
declare function resolveTypography(typography: TypographyStyle | undefined, tokens: DesignTokens): CSSProperties;
|
|
1484
|
+
|
|
1485
|
+
declare function defineTypography(typography: TypographyStyle): TypographyStyle;
|
|
1486
|
+
|
|
1487
|
+
declare function defineToken<T>(value: T): {
|
|
1488
|
+
value: T;
|
|
1489
|
+
};
|
|
1490
|
+
declare function defineSemanticToken<T>(light: T, dark: T): {
|
|
1491
|
+
value: {
|
|
1492
|
+
light: T;
|
|
1493
|
+
dark: T;
|
|
1494
|
+
};
|
|
1495
|
+
};
|
|
1496
|
+
|
|
1497
|
+
export { type AnimationTokens, type BaseColor, type BaseProps, type BaseTransition, type BaseVariant, Button, type ButtonProps, type CSSPropertiesWithVars, Checkbox, type CheckboxProps, type ClearableProps, type ColorMode, type ColorModeValue, type ColorProps, type ColorScale, type ColorTokens, Combobox, ComboboxContent, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, type ComboboxProps, type DeepPartial, type DesignTokens, type DisabledProps, type FontSizeTokens, type FontTokens, type FontWeightTokens, FormField, FormFieldControl, FormFieldDescription, FormFieldLabel, FormFieldMessage, type FormFieldProps, type FullWidthProps, Input, type InputKind, type InputKindDefaults, type InputProps, type InputSize, type InputVariant, type IntensityMap, type LetterSpacingTokens, type LineHeightTokens, type LoadingProps, MarkdownEditor, type MarkdownEditorProps, type MarkdownEditorTabs, MultiSelect, MultiSelectContent, MultiSelectContext, type MultiSelectContextValue, MultiSelectItem, type MultiSelectItemMeta, type MultiSelectItemProps, type MultiSelectProps, MultiSelectTrigger, type Orientation, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadioSize, type RadiusTokens, type RecipeCollection, type RecipeCompoundVariant, type RecipeDefinition, type RecipeProps, type RecipeStyle, type RecipeVariant, type RecipeVariantValue, type ResolvedSize, type ResolvedTokens, Select, SelectContent, type SelectContentProps, SelectContext, type SelectContextValue, SelectGroup, SelectGroupContext, type SelectGroupProps, SelectItem, type SelectItemMeta, type SelectItemProps, type SelectLabelProps, type SelectProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SemanticColorTokens, type SemanticToken, type SemanticTokens, type ShadowTokens, type Size, type SizeProps, type SizeScale, type SizeToken, type SizeValue, type SpacingTokens, type StateProps, type Styleable, Switch, type SwitchProps, Textarea, TextareaCore, type TextareaCoreProps, type TextareaProps, type TextareaResize, type Theme, ThemeContext, type ThemeContextValue, type ThemeOverride, ThemeToggler, type ThemeTogglerColor, type ThemeTogglerDisplay, type ThemeTogglerProps, type ThemeTogglerVariant, type ThemeTransition, type TokenDefinition, type TokenGroup, type TokenValue, type Typography, type TypographyProps, type TypographyStyle, UIProvider, type UIProviderProps, type UseSizeStyleOptions, type ValueProps, type Variant, type VariantProps, buttonBase, buttonColors, buttonRecipe, buttonVariants, cn, defaultRecipes, defaultSizes, defaultTheme, defineRecipe, defineSemanticToken, defineToken, defineTypography, formControlBase, formControlRecipe, formControlStates, formControlVariants, hexToRgbString, inputBase, inputKindDefaults, inputRecipe, mergeRecipes, resolveRecipe, resolveTypography, rgbToHex, tokensToCssVars, useBreakpoint, useFloatingSide, useMultiSelectContext, useSelectContext, useSizeStyle, useStateTransition, useTheme, useTypography };
|
package/dist/index.js
CHANGED
|
@@ -372,6 +372,12 @@ function resolveTypography(typography, tokens) {
|
|
|
372
372
|
}
|
|
373
373
|
__name(resolveTypography, "resolveTypography");
|
|
374
374
|
|
|
375
|
+
// src/theme/typography/defineTypography.ts
|
|
376
|
+
function defineTypography(typography) {
|
|
377
|
+
return typography;
|
|
378
|
+
}
|
|
379
|
+
__name(defineTypography, "defineTypography");
|
|
380
|
+
|
|
375
381
|
// src/theme/token/defineToken.ts
|
|
376
382
|
function defineToken(value) {
|
|
377
383
|
return {
|
|
@@ -546,6 +552,7 @@ var Button = forwardRef(
|
|
|
546
552
|
className: resolvedClassName,
|
|
547
553
|
style: resolvedStyle,
|
|
548
554
|
disabled: disabled || isLoading,
|
|
555
|
+
"aria-disabled": disabled || isLoading,
|
|
549
556
|
"aria-busy": isLoading || void 0,
|
|
550
557
|
children: content
|
|
551
558
|
});
|
|
@@ -3986,6 +3993,6 @@ function UIProvider({
|
|
|
3986
3993
|
}
|
|
3987
3994
|
__name(UIProvider, "UIProvider");
|
|
3988
3995
|
|
|
3989
|
-
export { Button, Checkbox, Combobox, ComboboxContent, ComboboxInput, ComboboxItem, FormField, FormFieldControl, FormFieldDescription, FormFieldLabel, FormFieldMessage, Input, MarkdownEditor, MultiSelect, MultiSelectContent, MultiSelectContext, MultiSelectItem, MultiSelectTrigger, Radio, RadioGroup, Select, SelectContent, SelectContext, SelectGroup, SelectGroupContext, SelectItem, SelectTrigger, SelectValue, Switch, Textarea, TextareaCore, ThemeContext, ThemeToggler, UIProvider, cn, defaultRecipes, defaultSizes, defaultTheme, hexToRgbString, inputKindDefaults, rgbToHex, tokensToCssVars, useBreakpoint, useFloatingSide, useMultiSelectContext, useSelectContext, useSizeStyle, useStateTransition, useTheme, useTypography };
|
|
3996
|
+
export { Button, Checkbox, Combobox, ComboboxContent, ComboboxInput, ComboboxItem, FormField, FormFieldControl, FormFieldDescription, FormFieldLabel, FormFieldMessage, Input, MarkdownEditor, MultiSelect, MultiSelectContent, MultiSelectContext, MultiSelectItem, MultiSelectTrigger, Radio, RadioGroup, Select, SelectContent, SelectContext, SelectGroup, SelectGroupContext, SelectItem, SelectTrigger, SelectValue, Switch, Textarea, TextareaCore, ThemeContext, ThemeToggler, UIProvider, buttonBase, buttonColors, buttonRecipe, buttonVariants, cn, defaultRecipes, defaultSizes, defaultTheme, defineRecipe, defineSemanticToken, defineToken, defineTypography, formControlBase, formControlRecipe, formControlStates, formControlVariants, hexToRgbString, inputBase, inputKindDefaults, inputRecipe, mergeRecipes, resolveRecipe, resolveTypography, rgbToHex, tokensToCssVars, useBreakpoint, useFloatingSide, useMultiSelectContext, useSelectContext, useSizeStyle, useStateTransition, useTheme, useTypography };
|
|
3990
3997
|
//# sourceMappingURL=index.js.map
|
|
3991
3998
|
//# sourceMappingURL=index.js.map
|