@vygruppen/spor-react 12.7.0 → 12.7.1

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.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: ReactNode;
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", {
@@ -1779,7 +1840,7 @@ declare const Textarea: React__default.ForwardRefExoticComponent<TextareaProps$1
1779
1840
 
1780
1841
  declare const PressableCard: React$1.ForwardRefExoticComponent<{
1781
1842
  variant?: _chakra_ui_react.ConditionalValue<"core" | "floating" | "accent" | undefined>;
1782
- } & ButtonProps$1 & React$1.RefAttributes<HTMLDivElement>>;
1843
+ } & ButtonProps$1 & React$1.RefAttributes<HTMLButtonElement>>;
1783
1844
 
1784
1845
  declare const RadioCard: React__default.ForwardRefExoticComponent<RadioCard$1.ItemProps & {
1785
1846
  variant?: _chakra_ui_react.ConditionalValue<"core" | "floating" | undefined>;
@@ -1838,6 +1899,42 @@ declare const staticCardRecipe: _chakra_ui_react.RecipeDefinition<{
1838
1899
  };
1839
1900
  }>;
1840
1901
 
1902
+ /**
1903
+ * `StaticCard` is a component that renders a static card.
1904
+ *
1905
+ * The `StaticCard` component can be used to create a card that does not respond to user interactions.
1906
+ * It can be rendered as any HTML element by specifying the `as` prop.
1907
+ *
1908
+ * The `colorPalette` prop can be used to control the color palette of the card. It defaults to "white".
1909
+ *
1910
+ * Example usage:
1911
+ *
1912
+ * ```tsx
1913
+ * <StaticCard>
1914
+ * Content
1915
+ * </StaticCard>
1916
+ * ```
1917
+ *
1918
+ * To render the card as a different HTML element, specify the `as` prop:
1919
+ *
1920
+ * ```tsx
1921
+ * <StaticCard as="section">
1922
+ * This is now a <section /> element
1923
+ * </StaticCard>
1924
+ * ```
1925
+ *
1926
+ * To change the color palette of the card, specify the `colorPalette` prop:
1927
+ *
1928
+ * ```tsx
1929
+ * <StaticCard colorPalette="orange">
1930
+ * An orange card
1931
+ * </StaticCard>
1932
+ * ```
1933
+ *
1934
+ * For a card with click functionality, use the `PressableCard` component.
1935
+ *
1936
+ * @see PressableCard
1937
+ */
1841
1938
  type StaticCardProps = RecipeVariantProps<typeof staticCardRecipe> & BoxProps;
1842
1939
  declare const StaticCard: React$1.ForwardRefExoticComponent<{
1843
1940
  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: ReactNode;
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", {
@@ -1779,7 +1840,7 @@ declare const Textarea: React__default.ForwardRefExoticComponent<TextareaProps$1
1779
1840
 
1780
1841
  declare const PressableCard: React$1.ForwardRefExoticComponent<{
1781
1842
  variant?: _chakra_ui_react.ConditionalValue<"core" | "floating" | "accent" | undefined>;
1782
- } & ButtonProps$1 & React$1.RefAttributes<HTMLDivElement>>;
1843
+ } & ButtonProps$1 & React$1.RefAttributes<HTMLButtonElement>>;
1783
1844
 
1784
1845
  declare const RadioCard: React__default.ForwardRefExoticComponent<RadioCard$1.ItemProps & {
1785
1846
  variant?: _chakra_ui_react.ConditionalValue<"core" | "floating" | undefined>;
@@ -1838,6 +1899,42 @@ declare const staticCardRecipe: _chakra_ui_react.RecipeDefinition<{
1838
1899
  };
1839
1900
  }>;
1840
1901
 
1902
+ /**
1903
+ * `StaticCard` is a component that renders a static card.
1904
+ *
1905
+ * The `StaticCard` component can be used to create a card that does not respond to user interactions.
1906
+ * It can be rendered as any HTML element by specifying the `as` prop.
1907
+ *
1908
+ * The `colorPalette` prop can be used to control the color palette of the card. It defaults to "white".
1909
+ *
1910
+ * Example usage:
1911
+ *
1912
+ * ```tsx
1913
+ * <StaticCard>
1914
+ * Content
1915
+ * </StaticCard>
1916
+ * ```
1917
+ *
1918
+ * To render the card as a different HTML element, specify the `as` prop:
1919
+ *
1920
+ * ```tsx
1921
+ * <StaticCard as="section">
1922
+ * This is now a <section /> element
1923
+ * </StaticCard>
1924
+ * ```
1925
+ *
1926
+ * To change the color palette of the card, specify the `colorPalette` prop:
1927
+ *
1928
+ * ```tsx
1929
+ * <StaticCard colorPalette="orange">
1930
+ * An orange card
1931
+ * </StaticCard>
1932
+ * ```
1933
+ *
1934
+ * For a card with click functionality, use the `PressableCard` component.
1935
+ *
1936
+ * @see PressableCard
1937
+ */
1841
1938
  type StaticCardProps = RecipeVariantProps<typeof staticCardRecipe> & BoxProps;
1842
1939
  declare const StaticCard: React$1.ForwardRefExoticComponent<{
1843
1940
  colorPalette?: _chakra_ui_react.ConditionalValue<"white" | "blue" | "green" | "grey" | "orange" | "red" | "yellow" | "darkYellow" | undefined>;