@qasa/qds-ui 0.32.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as _emotion_react from '@emotion/react';
3
2
  import { EmotionCache, CSSObject } from '@emotion/react';
4
3
  import * as react from 'react';
5
4
  import { ElementType, ComponentPropsWithoutRef, ReactNode, SVGAttributes, ReactElement, useLayoutEffect } from 'react';
5
+ import * as class_variance_authority_types from 'class-variance-authority/types';
6
+ import { VariantProps as VariantProps$1 } from 'class-variance-authority';
6
7
  import { Checkbox as Checkbox$1, DropdownMenu as DropdownMenu$1, RadioGroup as RadioGroup$1, Switch as Switch$1, Toast as Toast$1 } from 'radix-ui';
7
- import * as _emotion_styled from '@emotion/styled';
8
8
  import { LucideIcon } from 'lucide-react';
9
9
 
10
10
  /**
@@ -879,15 +879,15 @@ type BreakpointsConfig$1<T> = PartialRecord<keyof Theme['breakpoints'], T> & {
879
879
  };
880
880
  type ResponsiveProp<T> = T | BreakpointsConfig$1<T>;
881
881
 
882
- declare const SIZE_MAP: {
883
- xs: number;
884
- sm: number;
885
- md: number;
886
- lg: number;
887
- xl: number;
888
- '2xl': number;
882
+ declare const SIZE_CLASSES$4: {
883
+ xs: string;
884
+ sm: string;
885
+ md: string;
886
+ lg: string;
887
+ xl: string;
888
+ '2xl': string;
889
889
  };
890
- type AvatarSize = keyof typeof SIZE_MAP;
890
+ type AvatarSize = keyof typeof SIZE_CLASSES$4;
891
891
  interface AvatarOptions {
892
892
  /**
893
893
  * Source url of the image to display. If not passed
@@ -1060,169 +1060,18 @@ declare const UserIcon: react.ForwardRefExoticComponent<IconProps & react.RefAtt
1060
1060
  declare const XCircleIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1061
1061
  declare const XIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1062
1062
 
1063
- type NamedStyles = Record<string, CSSObject>;
1064
- type StyleInterpolation<T> = (theme: Theme) => T;
1065
- /**
1066
- * Creates a collection of named style rules.
1067
- */
1068
- declare function createStyleVariants<T extends NamedStyles>(styles: StyleInterpolation<T>): (theme: Theme) => T;
1069
- /**
1070
- * Create a style object. Useful for creating styles that depend on the theme.
1071
- */
1072
- declare function createStyle<T extends CSSObject>(styles: StyleInterpolation<T>): (theme: Theme) => T;
1073
- type VariantProps<T extends ReturnType<typeof createStyle | typeof createStyleVariants>> = keyof ReturnType<T>;
1074
- /**
1075
- * Converts css `px` unit to `rem`.
1076
- * Assumes the root font size is 16px.
1077
- */
1078
- declare const pxToRem: (px: number) => string;
1079
-
1080
- declare const getFormFieldBaseStyles: (theme: Theme) => {
1081
- '&::placeholder': {
1082
- color: string;
1083
- };
1084
- '&:hover': {
1085
- borderColor: string;
1086
- };
1087
- '&:focus': {
1088
- outline: number;
1089
- borderColor: string;
1090
- boxShadow: `0 0 0 1px ${string}`;
1091
- };
1092
- '&[aria-invalid="true"]': {
1093
- borderColor: string;
1094
- '&:focus': {
1095
- boxShadow: `0 0 0 1px ${string}`;
1096
- };
1097
- };
1098
- '&[disabled], &:disabled, &[data-disabled]': {
1099
- opacity: number;
1100
- borderColor: string;
1101
- };
1102
- transitionProperty: "opacity, border-color, box-shadow";
1103
- transitionDuration: "120ms";
1104
- transitionTimingFunction: "ease";
1105
- fontFamily: string;
1106
- fontWeight: string;
1107
- fontSize: string;
1108
- lineHeight: string;
1109
- letterSpacing: string;
1110
- width: string;
1111
- minWidth: number;
1112
- appearance: "none";
1113
- paddingLeft: string;
1114
- paddingRight: string;
1115
- border: string;
1116
- borderRadius: string;
1117
- backgroundColor: string;
1118
- color: string;
1119
- WebkitTouchCallout: "none";
1120
- WebkitTapHighlightColor: "transparent";
1121
- '&::-webkit-date-and-time-value': {
1122
- textAlign: "left";
1123
- };
1124
- alignItems: "center";
1063
+ declare const SIZE_CLASSES$3: {
1064
+ xs: string;
1065
+ sm: string;
1066
+ md: string;
1067
+ lg: string;
1068
+ xl: string;
1125
1069
  };
1126
-
1127
- declare const getSizeStyles$4: (theme: Theme) => {
1128
- xs: {
1129
- fontFamily: string;
1130
- fontWeight: string;
1131
- fontSize: string;
1132
- lineHeight: string;
1133
- letterSpacing: string;
1134
- height: string;
1135
- paddingLeft: string;
1136
- paddingRight: string;
1137
- };
1138
- sm: {
1139
- fontFamily: string;
1140
- fontWeight: string;
1141
- fontSize: string;
1142
- lineHeight: string;
1143
- letterSpacing: string;
1144
- height: string;
1145
- paddingLeft: string;
1146
- paddingRight: string;
1147
- };
1148
- md: {
1149
- fontFamily: string;
1150
- fontWeight: string;
1151
- fontSize: string;
1152
- lineHeight: string;
1153
- letterSpacing: string;
1154
- height: string;
1155
- paddingLeft: string;
1156
- paddingRight: string;
1157
- };
1158
- lg: {
1159
- fontFamily: string;
1160
- fontWeight: string;
1161
- fontSize: string;
1162
- lineHeight: string;
1163
- letterSpacing: string;
1164
- height: string;
1165
- paddingLeft: string;
1166
- paddingRight: string;
1167
- };
1168
- xl: {
1169
- fontFamily: string;
1170
- fontWeight: string;
1171
- fontSize: string;
1172
- lineHeight: string;
1173
- letterSpacing: string;
1174
- height: string;
1175
- paddingLeft: string;
1176
- paddingRight: string;
1177
- };
1178
- };
1179
- type ButtonSize = VariantProps<typeof getSizeStyles$4>;
1180
- declare const getVariantStyles$2: (theme: Theme) => {
1181
- primary: {
1182
- background: string;
1183
- color: string;
1184
- ":not([disabled])": {
1185
- '@media(hover: hover)': {
1186
- ':hover': {
1187
- background: string;
1188
- };
1189
- };
1190
- ':active': {
1191
- background: string;
1192
- };
1193
- };
1194
- };
1195
- secondary: {
1196
- background: string;
1197
- color: string;
1198
- ":not([disabled])": {
1199
- '@media(hover: hover)': {
1200
- ':hover': {
1201
- background: string;
1202
- };
1203
- };
1204
- ':active': {
1205
- background: string;
1206
- };
1207
- };
1208
- };
1209
- tertiary: {
1210
- background: string;
1211
- color: string;
1212
- ":not([disabled])": {
1213
- '@media(hover: hover)': {
1214
- ':hover': {
1215
- background: string;
1216
- };
1217
- };
1218
- ':active': {
1219
- background: string;
1220
- };
1221
- };
1222
- };
1223
- };
1224
- type ButtonVariant = VariantProps<typeof getVariantStyles$2>;
1225
-
1070
+ declare const buttonVariants: (props?: ({
1071
+ variant?: "primary" | "secondary" | "tertiary" | "danger" | null | undefined;
1072
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1073
+ type ButtonSize = keyof typeof SIZE_CLASSES$3;
1074
+ type ButtonVariant = NonNullable<VariantProps$1<typeof buttonVariants>['variant']>;
1226
1075
  interface ButtonOptions {
1227
1076
  /**
1228
1077
  * Sets the size of the button
@@ -1263,7 +1112,6 @@ interface ButtonOptions {
1263
1112
  */
1264
1113
  type?: 'button' | 'submit' | 'reset';
1265
1114
  }
1266
-
1267
1115
  type PolymorphicButton = ForwardRefComponent<'button', ButtonOptions>;
1268
1116
  type ButtonProps = PropsOf<PolymorphicButton>;
1269
1117
  declare const Button: PolymorphicButton;
@@ -1390,7 +1238,7 @@ interface DividerOptions {
1390
1238
  }
1391
1239
  interface DividerProps extends HTMLQdsProps<'span'>, DividerOptions {
1392
1240
  }
1393
- declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
1241
+ declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLSpanElement>>;
1394
1242
 
1395
1243
  type PrimitiveContentProps = DropdownMenu$1.DropdownMenuContentProps;
1396
1244
  interface DropdownMenuContentOptions {
@@ -1543,108 +1391,26 @@ type HeadingProps = PropsOf<HeadingComponent>;
1543
1391
  */
1544
1392
  declare const Heading: HeadingComponent;
1545
1393
 
1546
- type HintBoxTitleProps = HTMLQdsProps<'span'>;
1394
+ type HintBoxTitleProps = HTMLQdsProps<'p'>;
1547
1395
  type HintBoxProps = HTMLQdsProps<'aside'>;
1548
1396
  declare const HintBox: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & react.RefAttributes<HTMLElement>> & {
1549
- Title: _emotion_styled.StyledComponent<{
1550
- theme?: _emotion_react.Theme;
1551
- as?: React.ElementType;
1552
- }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
1397
+ Title: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
1553
1398
  };
1554
1399
 
1555
- declare const getSizeStyles$3: (theme: Theme) => {
1556
- xs: {
1557
- width: string;
1558
- height: string;
1559
- };
1560
- sm: {
1561
- width: string;
1562
- height: string;
1563
- };
1564
- md: {
1565
- width: string;
1566
- height: string;
1567
- };
1400
+ declare const SIZE_CLASSES$2: {
1401
+ xs: string;
1402
+ sm: string;
1403
+ md: string;
1568
1404
  };
1569
- declare const getVariantStyles$1: (theme: Theme) => {
1570
- primary: {
1571
- background: string;
1572
- color: string;
1573
- ":not([disabled])": {
1574
- '@media(hover: hover)': {
1575
- ':hover': {
1576
- background: string;
1577
- };
1578
- };
1579
- ':active': {
1580
- background: string;
1581
- };
1582
- };
1583
- };
1584
- secondary: {
1585
- background: string;
1586
- color: string;
1587
- ":not([disabled])": {
1588
- '@media(hover: hover)': {
1589
- ':hover': {
1590
- background: string;
1591
- };
1592
- };
1593
- ':active': {
1594
- background: string;
1595
- };
1596
- };
1597
- };
1598
- tertiary: {
1599
- background: string;
1600
- color: string;
1601
- ":not([disabled])": {
1602
- '@media(hover: hover)': {
1603
- ':hover': {
1604
- background: string;
1605
- };
1606
- };
1607
- ':active': {
1608
- background: string;
1609
- };
1610
- };
1611
- };
1612
- ghost: {
1613
- color: string;
1614
- ":not([disabled])": {
1615
- '@media(hover: hover)': {
1616
- ':hover': {
1617
- background: string;
1618
- };
1619
- };
1620
- ':active': {
1621
- background: string;
1622
- };
1623
- };
1624
- };
1625
- white: {
1626
- background: string;
1627
- color: string;
1628
- ":not([disabled])": {
1629
- '@media(hover: hover)': {
1630
- ':hover': {
1631
- background: string;
1632
- };
1633
- };
1634
- ':active': {
1635
- background: string;
1636
- };
1637
- };
1638
- };
1639
- };
1640
-
1641
- type IconButtonSize = VariantProps<typeof getSizeStyles$3>;
1642
- type IconButtonVariant = VariantProps<typeof getVariantStyles$1>;
1405
+ declare const iconButtonVariants: (props?: ({
1406
+ variant?: "white" | "primary" | "secondary" | "tertiary" | "danger" | "ghost" | null | undefined;
1407
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1408
+ type IconButtonSize = keyof typeof SIZE_CLASSES$2;
1409
+ type IconButtonVariant = NonNullable<VariantProps$1<typeof iconButtonVariants>['variant']>;
1643
1410
  interface IconButtonOptions {
1644
1411
  icon: ElementType<IconProps>;
1645
1412
  /**
1646
1413
  * A visually hidden label read by screen readers.
1647
- *
1648
1414
  */
1649
1415
  label: string;
1650
1416
  /**
@@ -1712,24 +1478,24 @@ interface TextFieldProps extends Omit<HTMLQdsProps<'input'>, OmittedProps$7>, Te
1712
1478
  }
1713
1479
  declare const TextField: react.ForwardRefExoticComponent<TextFieldProps & react.RefAttributes<HTMLInputElement>>;
1714
1480
 
1715
- declare const getSizeStyles$2: (theme: Theme) => {
1716
- sm: {
1717
- fontFamily: string;
1718
- fontWeight: string;
1719
- fontSize: string;
1720
- lineHeight: string;
1721
- letterSpacing: string;
1722
- };
1723
- md: {
1724
- fontFamily: string;
1725
- fontWeight: string;
1726
- fontSize: string;
1727
- lineHeight: string;
1728
- letterSpacing: string;
1729
- };
1481
+ declare const SIZE_CLASSES$1: {
1482
+ sm: string;
1483
+ md: string;
1730
1484
  };
1731
- type LabelSize = VariantProps<typeof getSizeStyles$2>;
1732
- type LabelColor = keyof Theme['colors']['text'];
1485
+ declare const COLOR_CLASSES: {
1486
+ readonly strong: "text-strong";
1487
+ readonly default: "text-default";
1488
+ readonly subtle: "text-subtle";
1489
+ readonly disabled: "text-disabled";
1490
+ readonly negative: "text-negative";
1491
+ readonly warning: "text-warning";
1492
+ readonly positive: "text-positive";
1493
+ readonly onBrandPrimary: "text-onBrandPrimary";
1494
+ readonly onBrandSecondary: "text-onBrandSecondary";
1495
+ readonly onBrandTertiary: "text-onBrandTertiary";
1496
+ };
1497
+ type LabelSize = keyof typeof SIZE_CLASSES$1;
1498
+ type LabelColor = keyof typeof COLOR_CLASSES;
1733
1499
  interface LabelOptions {
1734
1500
  /**
1735
1501
  * Size of the label
@@ -1759,15 +1525,11 @@ type LinkComponent = ForwardRefComponent<'a', LinkOptions>;
1759
1525
  type LinkProps = PropsOf<LinkComponent>;
1760
1526
  declare const Link: LinkComponent;
1761
1527
 
1762
- declare const getSizeStyles$1: (theme: Theme) => {
1763
- sm: {
1764
- fontSize: string;
1765
- };
1766
- md: {
1767
- fontSize: string;
1768
- };
1528
+ declare const SIZE_CLASSES: {
1529
+ sm: string;
1530
+ md: string;
1769
1531
  };
1770
- type LoadingDotsSize = VariantProps<typeof getSizeStyles$1>;
1532
+ type LoadingDotsSize = keyof typeof SIZE_CLASSES;
1771
1533
  interface LoadingDotsOptions {
1772
1534
  size?: ResponsiveProp<LoadingDotsSize>;
1773
1535
  }
@@ -1775,6 +1537,70 @@ interface LoadingDotsProps extends HTMLQdsProps<'span'>, LoadingDotsOptions {
1775
1537
  }
1776
1538
  declare const LoadingDots: react.ForwardRefExoticComponent<LoadingDotsProps & react.RefAttributes<HTMLSpanElement>>;
1777
1539
 
1540
+ type NamedStyles = Record<string, CSSObject>;
1541
+ type StyleInterpolation<T> = (theme: Theme) => T;
1542
+ /**
1543
+ * Creates a collection of named style rules.
1544
+ */
1545
+ declare function createStyleVariants<T extends NamedStyles>(styles: StyleInterpolation<T>): (theme: Theme) => T;
1546
+ /**
1547
+ * Create a style object. Useful for creating styles that depend on the theme.
1548
+ */
1549
+ declare function createStyle<T extends CSSObject>(styles: StyleInterpolation<T>): (theme: Theme) => T;
1550
+ type VariantProps<T extends ReturnType<typeof createStyle | typeof createStyleVariants>> = keyof ReturnType<T>;
1551
+ /**
1552
+ * Converts css `px` unit to `rem`.
1553
+ * Assumes the root font size is 16px.
1554
+ */
1555
+ declare const pxToRem: (px: number) => string;
1556
+
1557
+ declare const getFormFieldBaseStyles: (theme: Theme) => {
1558
+ '&::placeholder': {
1559
+ color: string;
1560
+ };
1561
+ '&:hover': {
1562
+ borderColor: string;
1563
+ };
1564
+ '&:focus': {
1565
+ outline: number;
1566
+ borderColor: string;
1567
+ boxShadow: `0 0 0 1px ${string}`;
1568
+ };
1569
+ '&[aria-invalid="true"]': {
1570
+ borderColor: string;
1571
+ '&:focus': {
1572
+ boxShadow: `0 0 0 1px ${string}`;
1573
+ };
1574
+ };
1575
+ '&[disabled], &:disabled, &[data-disabled]': {
1576
+ opacity: number;
1577
+ borderColor: string;
1578
+ };
1579
+ transitionProperty: "opacity, border-color, box-shadow";
1580
+ transitionDuration: "120ms";
1581
+ transitionTimingFunction: "ease";
1582
+ fontFamily: string;
1583
+ fontWeight: string;
1584
+ fontSize: string;
1585
+ lineHeight: string;
1586
+ letterSpacing: string;
1587
+ width: string;
1588
+ minWidth: number;
1589
+ appearance: "none";
1590
+ paddingLeft: string;
1591
+ paddingRight: string;
1592
+ border: string;
1593
+ borderRadius: string;
1594
+ backgroundColor: string;
1595
+ color: string;
1596
+ WebkitTouchCallout: "none";
1597
+ WebkitTapHighlightColor: "transparent";
1598
+ '&::-webkit-date-and-time-value': {
1599
+ textAlign: "left";
1600
+ };
1601
+ alignItems: "center";
1602
+ };
1603
+
1778
1604
  declare const getSizeStyles: (theme: Theme) => {
1779
1605
  xs: {
1780
1606
  fontFamily: string;