@vygruppen/spor-react 12.7.0 → 12.8.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/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-postinstall.log +1 -1
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs +332 -309
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +102 -4
- package/dist/index.d.ts +102 -4
- package/dist/index.mjs +333 -310
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/button/ButtonGroup.tsx +5 -15
- package/src/dialog/Dialog.tsx +1 -1
- package/src/input/AttachedInputs.tsx +6 -4
- package/src/input/Combobox.tsx +5 -4
- package/src/input/CountryCodeSelect.tsx +1 -1
- package/src/input/Field.tsx +1 -1
- package/src/input/Input.tsx +9 -8
- package/src/input/Select.tsx +3 -2
- package/src/layout/PressableCard.tsx +12 -5
- package/src/layout/StaticCard.tsx +6 -4
- package/src/theme/recipes/index.ts +2 -0
- package/src/theme/slot-recipes/anatomy.ts +2 -0
- package/src/theme/slot-recipes/collapsible.ts +21 -0
- package/src/theme/slot-recipes/index.ts +2 -0
- package/src/theme/slot-recipes/select.ts +2 -0
package/dist/index.d.cts
CHANGED
@@ -355,6 +355,38 @@ declare const groupRecipe: _chakra_ui_react.RecipeDefinition<{
|
|
355
355
|
|
356
356
|
type GroupVariantProps = RecipeVariantProps<typeof groupRecipe>;
|
357
357
|
type ButtonGroupProps = GroupProps & PropsWithChildren<GroupVariantProps>;
|
358
|
+
/**
|
359
|
+
* Used to group or attach buttons together.
|
360
|
+
*
|
361
|
+
* If you have more than one button next to eachother, you might want to add a `ButtonGroup` to group them.
|
362
|
+
*
|
363
|
+
* ```tsx
|
364
|
+
* <ButtonGroup>
|
365
|
+
* <Button variant="secondary">Cancel</Button>
|
366
|
+
* <Button variant="primary">Save</Button>
|
367
|
+
* </ButtonGroup>
|
368
|
+
* ```
|
369
|
+
*
|
370
|
+
*
|
371
|
+
* Attach buttons together with the `attached` prop.
|
372
|
+
*
|
373
|
+
* ```tsx
|
374
|
+
* <ButtonGroup attached>
|
375
|
+
* <Button variant="primary">Open</Button>
|
376
|
+
* <IconButton variant="ghost">
|
377
|
+
* <SaveIcon aria-label="Save"/>
|
378
|
+
* </IconButton>
|
379
|
+
* </ButtonGroup>
|
380
|
+
* ```
|
381
|
+
*
|
382
|
+
* Use the `grow` prop to make the buttons grow to fill the available space.
|
383
|
+
*
|
384
|
+
* ```tsx
|
385
|
+
* <ButtonGroup grow>
|
386
|
+
* <Button variant="primary">Open</Button>
|
387
|
+
* <Button variant="secondary">Save</Button>
|
388
|
+
* </ButtonGroup>
|
389
|
+
*/
|
358
390
|
declare const ButtonGroup: React$1.ForwardRefExoticComponent<GroupProps & {
|
359
391
|
disabled?: _chakra_ui_react.ConditionalValue<boolean | undefined>;
|
360
392
|
} & {
|
@@ -1193,12 +1225,41 @@ type ChakraInputProps = ComponentProps<typeof Input$1>;
|
|
1193
1225
|
|
1194
1226
|
type InputProps = FieldProps & Exclude<ChakraInputProps, "size" | "label" | "colorPalette" | "placeholder"> & {
|
1195
1227
|
/** The input's label */
|
1196
|
-
label
|
1228
|
+
label?: ReactNode;
|
1197
1229
|
/** Element that shows up to the left */
|
1198
1230
|
startElement?: React__default.ReactNode;
|
1199
1231
|
/** Element that shows up to the right */
|
1200
1232
|
endElement?: React__default.ReactNode;
|
1201
1233
|
};
|
1234
|
+
/**
|
1235
|
+
* Inputs let you enter text or other data.
|
1236
|
+
*
|
1237
|
+
* You need to specify the label as a prop, since it doubles as the placeholder.
|
1238
|
+
*
|
1239
|
+
* ```tsx
|
1240
|
+
* <Input label="E-mail" />
|
1241
|
+
* ```
|
1242
|
+
*
|
1243
|
+
* You can also add icons to the left and right of the input. Please use the 24 px icons for this.
|
1244
|
+
*
|
1245
|
+
* ```tsx
|
1246
|
+
* <Input label="E-mail" startElement={<EmailOutline24Icon />} />
|
1247
|
+
* ```
|
1248
|
+
*
|
1249
|
+
* Input has two variants core, and floating.
|
1250
|
+
*
|
1251
|
+
* ```tsx
|
1252
|
+
* <Input label="E-mail" startElement={<EmailOutline24Icon />} variant="floating" />
|
1253
|
+
* ```
|
1254
|
+
*
|
1255
|
+
* Field is added to Input, so you can add helperText, errorText, and optionalText.
|
1256
|
+
*
|
1257
|
+
* ```tsx
|
1258
|
+
* <Input label="E-mail" startElement={<EmailOutline24Icon />} helperText="We will never share your email." />
|
1259
|
+
* ```
|
1260
|
+
*
|
1261
|
+
* @see https://spor.vy.no/components/input
|
1262
|
+
*/
|
1202
1263
|
declare const Input: React__default.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
|
1203
1264
|
|
1204
1265
|
declare const listBoxSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "item" | "description" | "label", {
|
@@ -1570,8 +1631,9 @@ type SelectProps = SelectRootProps & FieldProps & {
|
|
1570
1631
|
/**
|
1571
1632
|
* A Select component.
|
1572
1633
|
*
|
1573
|
-
* This component is useful to choose an item from a dropdown list of items. The list has
|
1574
|
-
*
|
1634
|
+
* This component is useful to choose an item from a dropdown list of items. The list has two different variants, core, floating and floating.
|
1635
|
+
* It also has a sideRadiusVariant that can be used to make the sides square, rightSideSquare, leftSideSquare.
|
1636
|
+
* The sideRadiusVariant is useful in attachecdInput for example in the PhoneNumberInput and CountryCodeSelect components.
|
1575
1637
|
*
|
1576
1638
|
* @example
|
1577
1639
|
* ```tsx
|
@@ -1779,7 +1841,7 @@ declare const Textarea: React__default.ForwardRefExoticComponent<TextareaProps$1
|
|
1779
1841
|
|
1780
1842
|
declare const PressableCard: React$1.ForwardRefExoticComponent<{
|
1781
1843
|
variant?: _chakra_ui_react.ConditionalValue<"core" | "floating" | "accent" | undefined>;
|
1782
|
-
} & ButtonProps$1 & React$1.RefAttributes<
|
1844
|
+
} & ButtonProps$1 & React$1.RefAttributes<HTMLButtonElement>>;
|
1783
1845
|
|
1784
1846
|
declare const RadioCard: React__default.ForwardRefExoticComponent<RadioCard$1.ItemProps & {
|
1785
1847
|
variant?: _chakra_ui_react.ConditionalValue<"core" | "floating" | undefined>;
|
@@ -1838,6 +1900,42 @@ declare const staticCardRecipe: _chakra_ui_react.RecipeDefinition<{
|
|
1838
1900
|
};
|
1839
1901
|
}>;
|
1840
1902
|
|
1903
|
+
/**
|
1904
|
+
* `StaticCard` is a component that renders a static card.
|
1905
|
+
*
|
1906
|
+
* The `StaticCard` component can be used to create a card that does not respond to user interactions.
|
1907
|
+
* It can be rendered as any HTML element by specifying the `as` prop.
|
1908
|
+
*
|
1909
|
+
* The `colorPalette` prop can be used to control the color palette of the card. It defaults to "white".
|
1910
|
+
*
|
1911
|
+
* Example usage:
|
1912
|
+
*
|
1913
|
+
* ```tsx
|
1914
|
+
* <StaticCard>
|
1915
|
+
* Content
|
1916
|
+
* </StaticCard>
|
1917
|
+
* ```
|
1918
|
+
*
|
1919
|
+
* To render the card as a different HTML element, specify the `as` prop:
|
1920
|
+
*
|
1921
|
+
* ```tsx
|
1922
|
+
* <StaticCard as="section">
|
1923
|
+
* This is now a <section /> element
|
1924
|
+
* </StaticCard>
|
1925
|
+
* ```
|
1926
|
+
*
|
1927
|
+
* To change the color palette of the card, specify the `colorPalette` prop:
|
1928
|
+
*
|
1929
|
+
* ```tsx
|
1930
|
+
* <StaticCard colorPalette="orange">
|
1931
|
+
* An orange card
|
1932
|
+
* </StaticCard>
|
1933
|
+
* ```
|
1934
|
+
*
|
1935
|
+
* For a card with click functionality, use the `PressableCard` component.
|
1936
|
+
*
|
1937
|
+
* @see PressableCard
|
1938
|
+
*/
|
1841
1939
|
type StaticCardProps = RecipeVariantProps<typeof staticCardRecipe> & BoxProps;
|
1842
1940
|
declare const StaticCard: React$1.ForwardRefExoticComponent<{
|
1843
1941
|
colorPalette?: _chakra_ui_react.ConditionalValue<"white" | "blue" | "green" | "grey" | "orange" | "red" | "yellow" | "darkYellow" | undefined>;
|
package/dist/index.d.ts
CHANGED
@@ -355,6 +355,38 @@ declare const groupRecipe: _chakra_ui_react.RecipeDefinition<{
|
|
355
355
|
|
356
356
|
type GroupVariantProps = RecipeVariantProps<typeof groupRecipe>;
|
357
357
|
type ButtonGroupProps = GroupProps & PropsWithChildren<GroupVariantProps>;
|
358
|
+
/**
|
359
|
+
* Used to group or attach buttons together.
|
360
|
+
*
|
361
|
+
* If you have more than one button next to eachother, you might want to add a `ButtonGroup` to group them.
|
362
|
+
*
|
363
|
+
* ```tsx
|
364
|
+
* <ButtonGroup>
|
365
|
+
* <Button variant="secondary">Cancel</Button>
|
366
|
+
* <Button variant="primary">Save</Button>
|
367
|
+
* </ButtonGroup>
|
368
|
+
* ```
|
369
|
+
*
|
370
|
+
*
|
371
|
+
* Attach buttons together with the `attached` prop.
|
372
|
+
*
|
373
|
+
* ```tsx
|
374
|
+
* <ButtonGroup attached>
|
375
|
+
* <Button variant="primary">Open</Button>
|
376
|
+
* <IconButton variant="ghost">
|
377
|
+
* <SaveIcon aria-label="Save"/>
|
378
|
+
* </IconButton>
|
379
|
+
* </ButtonGroup>
|
380
|
+
* ```
|
381
|
+
*
|
382
|
+
* Use the `grow` prop to make the buttons grow to fill the available space.
|
383
|
+
*
|
384
|
+
* ```tsx
|
385
|
+
* <ButtonGroup grow>
|
386
|
+
* <Button variant="primary">Open</Button>
|
387
|
+
* <Button variant="secondary">Save</Button>
|
388
|
+
* </ButtonGroup>
|
389
|
+
*/
|
358
390
|
declare const ButtonGroup: React$1.ForwardRefExoticComponent<GroupProps & {
|
359
391
|
disabled?: _chakra_ui_react.ConditionalValue<boolean | undefined>;
|
360
392
|
} & {
|
@@ -1193,12 +1225,41 @@ type ChakraInputProps = ComponentProps<typeof Input$1>;
|
|
1193
1225
|
|
1194
1226
|
type InputProps = FieldProps & Exclude<ChakraInputProps, "size" | "label" | "colorPalette" | "placeholder"> & {
|
1195
1227
|
/** The input's label */
|
1196
|
-
label
|
1228
|
+
label?: ReactNode;
|
1197
1229
|
/** Element that shows up to the left */
|
1198
1230
|
startElement?: React__default.ReactNode;
|
1199
1231
|
/** Element that shows up to the right */
|
1200
1232
|
endElement?: React__default.ReactNode;
|
1201
1233
|
};
|
1234
|
+
/**
|
1235
|
+
* Inputs let you enter text or other data.
|
1236
|
+
*
|
1237
|
+
* You need to specify the label as a prop, since it doubles as the placeholder.
|
1238
|
+
*
|
1239
|
+
* ```tsx
|
1240
|
+
* <Input label="E-mail" />
|
1241
|
+
* ```
|
1242
|
+
*
|
1243
|
+
* You can also add icons to the left and right of the input. Please use the 24 px icons for this.
|
1244
|
+
*
|
1245
|
+
* ```tsx
|
1246
|
+
* <Input label="E-mail" startElement={<EmailOutline24Icon />} />
|
1247
|
+
* ```
|
1248
|
+
*
|
1249
|
+
* Input has two variants core, and floating.
|
1250
|
+
*
|
1251
|
+
* ```tsx
|
1252
|
+
* <Input label="E-mail" startElement={<EmailOutline24Icon />} variant="floating" />
|
1253
|
+
* ```
|
1254
|
+
*
|
1255
|
+
* Field is added to Input, so you can add helperText, errorText, and optionalText.
|
1256
|
+
*
|
1257
|
+
* ```tsx
|
1258
|
+
* <Input label="E-mail" startElement={<EmailOutline24Icon />} helperText="We will never share your email." />
|
1259
|
+
* ```
|
1260
|
+
*
|
1261
|
+
* @see https://spor.vy.no/components/input
|
1262
|
+
*/
|
1202
1263
|
declare const Input: React__default.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
|
1203
1264
|
|
1204
1265
|
declare const listBoxSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "item" | "description" | "label", {
|
@@ -1570,8 +1631,9 @@ type SelectProps = SelectRootProps & FieldProps & {
|
|
1570
1631
|
/**
|
1571
1632
|
* A Select component.
|
1572
1633
|
*
|
1573
|
-
* This component is useful to choose an item from a dropdown list of items. The list has
|
1574
|
-
*
|
1634
|
+
* This component is useful to choose an item from a dropdown list of items. The list has two different variants, core, floating and floating.
|
1635
|
+
* It also has a sideRadiusVariant that can be used to make the sides square, rightSideSquare, leftSideSquare.
|
1636
|
+
* The sideRadiusVariant is useful in attachecdInput for example in the PhoneNumberInput and CountryCodeSelect components.
|
1575
1637
|
*
|
1576
1638
|
* @example
|
1577
1639
|
* ```tsx
|
@@ -1779,7 +1841,7 @@ declare const Textarea: React__default.ForwardRefExoticComponent<TextareaProps$1
|
|
1779
1841
|
|
1780
1842
|
declare const PressableCard: React$1.ForwardRefExoticComponent<{
|
1781
1843
|
variant?: _chakra_ui_react.ConditionalValue<"core" | "floating" | "accent" | undefined>;
|
1782
|
-
} & ButtonProps$1 & React$1.RefAttributes<
|
1844
|
+
} & ButtonProps$1 & React$1.RefAttributes<HTMLButtonElement>>;
|
1783
1845
|
|
1784
1846
|
declare const RadioCard: React__default.ForwardRefExoticComponent<RadioCard$1.ItemProps & {
|
1785
1847
|
variant?: _chakra_ui_react.ConditionalValue<"core" | "floating" | undefined>;
|
@@ -1838,6 +1900,42 @@ declare const staticCardRecipe: _chakra_ui_react.RecipeDefinition<{
|
|
1838
1900
|
};
|
1839
1901
|
}>;
|
1840
1902
|
|
1903
|
+
/**
|
1904
|
+
* `StaticCard` is a component that renders a static card.
|
1905
|
+
*
|
1906
|
+
* The `StaticCard` component can be used to create a card that does not respond to user interactions.
|
1907
|
+
* It can be rendered as any HTML element by specifying the `as` prop.
|
1908
|
+
*
|
1909
|
+
* The `colorPalette` prop can be used to control the color palette of the card. It defaults to "white".
|
1910
|
+
*
|
1911
|
+
* Example usage:
|
1912
|
+
*
|
1913
|
+
* ```tsx
|
1914
|
+
* <StaticCard>
|
1915
|
+
* Content
|
1916
|
+
* </StaticCard>
|
1917
|
+
* ```
|
1918
|
+
*
|
1919
|
+
* To render the card as a different HTML element, specify the `as` prop:
|
1920
|
+
*
|
1921
|
+
* ```tsx
|
1922
|
+
* <StaticCard as="section">
|
1923
|
+
* This is now a <section /> element
|
1924
|
+
* </StaticCard>
|
1925
|
+
* ```
|
1926
|
+
*
|
1927
|
+
* To change the color palette of the card, specify the `colorPalette` prop:
|
1928
|
+
*
|
1929
|
+
* ```tsx
|
1930
|
+
* <StaticCard colorPalette="orange">
|
1931
|
+
* An orange card
|
1932
|
+
* </StaticCard>
|
1933
|
+
* ```
|
1934
|
+
*
|
1935
|
+
* For a card with click functionality, use the `PressableCard` component.
|
1936
|
+
*
|
1937
|
+
* @see PressableCard
|
1938
|
+
*/
|
1841
1939
|
type StaticCardProps = RecipeVariantProps<typeof staticCardRecipe> & BoxProps;
|
1842
1940
|
declare const StaticCard: React$1.ForwardRefExoticComponent<{
|
1843
1941
|
colorPalette?: _chakra_ui_react.ConditionalValue<"white" | "blue" | "green" | "grey" | "orange" | "red" | "yellow" | "darkYellow" | undefined>;
|