bonprix-design-system 0.59.0 → 0.60.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/README.md +52 -2
- package/dist/index.d.ts +54 -17
- package/dist/index.js +5984 -5958
- package/dist/index.js.map +1 -1
- package/dist/styles/default-variables.css +36 -0
- package/dist/styles/tailwind-components.css +62 -31
- package/dist/web-components.css +1 -0
- package/dist/web-components.d.ts +18 -0
- package/dist/web-components.js +154 -50
- package/dist/web-components.js.map +1 -1
- package/package.json +30 -29
package/README.md
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
[](https://storybook.bonprix.net/)
|
|
2
2
|
[](https://github.com/semantic-release/semantic-release)
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
# Design System
|
|
5
5
|
|
|
6
|
-
This repository contains design system's icons, fonts and a component library for the web plattform.
|
|
6
|
+
This repository contains the design system's icons, fonts and a component library for the web plattform.
|
|
7
|
+
|
|
8
|
+
## Getting Started
|
|
9
|
+
|
|
10
|
+
This guide will walk you through setting up the project for local development.
|
|
11
|
+
|
|
12
|
+
### Prerequisites
|
|
13
|
+
|
|
14
|
+
The required Node.js version is specified in the `.nvmrc` file. Use a version manager like `nvm` or `asdf` to install and use the correct version.
|
|
15
|
+
|
|
16
|
+
- Using `nvm`:
|
|
17
|
+
```bash
|
|
18
|
+
nvm install
|
|
19
|
+
nvm use
|
|
20
|
+
```
|
|
21
|
+
- Using `asdf`:
|
|
22
|
+
```bash
|
|
23
|
+
asdf install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Setup
|
|
27
|
+
|
|
28
|
+
1. **Install dependencies:**
|
|
29
|
+
```bash
|
|
30
|
+
npm install
|
|
31
|
+
```
|
|
32
|
+
2. **Initialize Git hooks:**
|
|
33
|
+
This command sets up hooks to ensure code consistency and quality.
|
|
34
|
+
```bash
|
|
35
|
+
npm run setup
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Local Development
|
|
39
|
+
|
|
40
|
+
There are two environments available for developing and testing components.
|
|
41
|
+
|
|
42
|
+
- **Storybook:**
|
|
43
|
+
For developing components in isolation. This is the primary development environment.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm run storybook
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Storybook will be running at `http://localhost:6006`.
|
|
50
|
+
|
|
51
|
+
- **Vite Playground:**
|
|
52
|
+
For testing components in a plain Vite application.
|
|
53
|
+
```bash
|
|
54
|
+
npm run dev
|
|
55
|
+
```
|
|
56
|
+
The playground will be running at `http://localhost:5173`.
|
package/dist/index.d.ts
CHANGED
|
@@ -520,6 +520,11 @@ export declare type CheckboxProps = {
|
|
|
520
520
|
|
|
521
521
|
export declare const Collapsible: FC<CollapsibleProps>;
|
|
522
522
|
|
|
523
|
+
declare interface CollapsibleImperativeHandle {
|
|
524
|
+
open: () => void;
|
|
525
|
+
close: () => void;
|
|
526
|
+
}
|
|
527
|
+
|
|
523
528
|
export declare interface CollapsibleProps {
|
|
524
529
|
/** Brief summary or label for the content within the component. */
|
|
525
530
|
title: ReactNode;
|
|
@@ -531,6 +536,8 @@ export declare interface CollapsibleProps {
|
|
|
531
536
|
initiallyOpened?: boolean;
|
|
532
537
|
/** A reference to the root element. */
|
|
533
538
|
rootRef?: RefObject<HTMLDivElement | null>;
|
|
539
|
+
/** A reference to the imperative handle of the component. */
|
|
540
|
+
imperativeRef?: Ref<CollapsibleImperativeHandle>;
|
|
534
541
|
/** The id of the collapsible component. */
|
|
535
542
|
id?: string;
|
|
536
543
|
/** Callback function that is called when the collapsible component is opened. */
|
|
@@ -629,14 +636,14 @@ declare type ControlledInputProps_4 = BaseProps_12 & {
|
|
|
629
636
|
onChange: (value: string) => void;
|
|
630
637
|
};
|
|
631
638
|
|
|
632
|
-
declare
|
|
639
|
+
declare type ControlledInputProps_5 = TextFieldBaseProps & {
|
|
633
640
|
/** The current value of the input field. Should be used in conjunction with `onChange`, when controlling the input. Should be `undefined` otherwise. */
|
|
634
641
|
value: string;
|
|
635
642
|
/** The default value of the input field. Should be used when the input is uncontrolled. */
|
|
636
643
|
defaultValue?: never;
|
|
637
644
|
/** Callback that is triggered when the input value changes. Should be used in conjunction with `value`, when controlling the input. Optional otherwise. */
|
|
638
645
|
onChange: (value: string) => void;
|
|
639
|
-
}
|
|
646
|
+
};
|
|
640
647
|
|
|
641
648
|
declare interface ControlledInputProps_6 extends BaseProps_13 {
|
|
642
649
|
/** The current value of the input field. Should be used in conjunction with `onChange`, when controlling the input. Should be `undefined` otherwise. */
|
|
@@ -664,6 +671,15 @@ declare interface ControlledSelectProps extends BaseProps_8 {
|
|
|
664
671
|
onValueChange: (value: string) => void;
|
|
665
672
|
}
|
|
666
673
|
|
|
674
|
+
declare interface DatelikeFieldBaseProps extends TextInputBaseProps {
|
|
675
|
+
/** The type of the input field. Refers to and is a subset of the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#input_types" target="_blank">HTML input type attribute</a>. */
|
|
676
|
+
type?: "date" | "datetime-local" | "time";
|
|
677
|
+
/** If `true`, hides the clear icon button. Always true for date-like types. */
|
|
678
|
+
hideClear?: never;
|
|
679
|
+
mask?: never;
|
|
680
|
+
unmask?: never;
|
|
681
|
+
}
|
|
682
|
+
|
|
667
683
|
export declare const Dialog: FC<DialogProps> & Subcomponents_3;
|
|
668
684
|
|
|
669
685
|
export declare interface DialogProps {
|
|
@@ -1008,6 +1024,17 @@ export declare interface RatingProps {
|
|
|
1008
1024
|
size?: "small" | "large";
|
|
1009
1025
|
}
|
|
1010
1026
|
|
|
1027
|
+
declare interface RegularFieldBaseProps extends TextInputBaseProps {
|
|
1028
|
+
/** The type of the input field. Refers to and is a subset of the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#input_types" target="_blank">HTML input type attribute</a>. */
|
|
1029
|
+
type?: "text" | "email";
|
|
1030
|
+
/** If `true`, hides the clear icon button. Always true for date-like types. */
|
|
1031
|
+
hideClear?: boolean;
|
|
1032
|
+
/** Any of valid mask types. We use <a href="https://imask.js.org/" target="_blank">IMask</a> behind the scenes. */
|
|
1033
|
+
mask?: string;
|
|
1034
|
+
/** If `true`, the input will return the unmasked/row value, instead of modified one. Will only have effect when `mask` is used. */
|
|
1035
|
+
unmask?: boolean;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1011
1038
|
declare interface RegularImage extends BasicProps {
|
|
1012
1039
|
/** The source set for the image, containing different resolutions. */
|
|
1013
1040
|
srcSet: SourceSetMapper;
|
|
@@ -1161,7 +1188,15 @@ declare interface SheetProps {
|
|
|
1161
1188
|
children: ReactNode;
|
|
1162
1189
|
/** Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property. */
|
|
1163
1190
|
isOpen: boolean;
|
|
1164
|
-
/** Callback function, that is triggered when the sheet is attempted to be closed.
|
|
1191
|
+
/** Callback function, that is triggered when the sheet is attempted to be closed.
|
|
1192
|
+
*
|
|
1193
|
+
* It will be called in following cases:
|
|
1194
|
+
* - Click on backdrop
|
|
1195
|
+
* - Swipe down to close
|
|
1196
|
+
* - Click on "close" icon button in the upper-right corner
|
|
1197
|
+
* - Click on any button (PrimaryButton or SecondaryButton)
|
|
1198
|
+
*
|
|
1199
|
+
* Should be used in conjunction with `isOpen`. */
|
|
1165
1200
|
onClose: () => void;
|
|
1166
1201
|
/** Callback to execute when clicking back icon. */
|
|
1167
1202
|
onBack?: () => void;
|
|
@@ -1174,7 +1209,15 @@ declare interface SheetProps_2 {
|
|
|
1174
1209
|
children: ReactNode;
|
|
1175
1210
|
/** Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property. */
|
|
1176
1211
|
isOpen: boolean;
|
|
1177
|
-
/** Callback function, that is triggered when the sheet is attempted to be closed.
|
|
1212
|
+
/** Callback function, that is triggered when the sheet is attempted to be closed.
|
|
1213
|
+
*
|
|
1214
|
+
* It will be called in following cases:
|
|
1215
|
+
* - Click on backdrop
|
|
1216
|
+
* - Swipe down to close
|
|
1217
|
+
* - Click on "close" icon button in the upper-right corner
|
|
1218
|
+
* - Click on any button (PrimaryButton or SecondaryButton)
|
|
1219
|
+
*
|
|
1220
|
+
* Should be used in conjunction with `isOpen`. */
|
|
1178
1221
|
onClose: () => void;
|
|
1179
1222
|
/** Callback to execute when clicking back icon. */
|
|
1180
1223
|
onBack?: () => void;
|
|
@@ -1228,7 +1271,7 @@ export declare interface ShowMoreListProps {
|
|
|
1228
1271
|
/** Whether the interaction box is hidden in fully expanded state. */
|
|
1229
1272
|
hideInteractionBoxWhenOpen?: boolean;
|
|
1230
1273
|
/** Whether the corners of inner containers (header, interaction box) are rounded. */
|
|
1231
|
-
roundedCorners?:
|
|
1274
|
+
roundedCorners?: "none" | "outside" | "all";
|
|
1232
1275
|
/** Slot to contain the component's children. `ShowMoreList.Item`s must be used for all countable children. Combine with your own `<li>` elements for customization (e.g. categories). */
|
|
1233
1276
|
children: ReactNode;
|
|
1234
1277
|
/** How many items should be shown initially. */
|
|
@@ -1459,6 +1502,9 @@ export declare const tailwindConfig: {
|
|
|
1459
1502
|
bonprixRegular: [string, string];
|
|
1460
1503
|
sourceSans3: [string, string];
|
|
1461
1504
|
};
|
|
1505
|
+
borderRadius: {
|
|
1506
|
+
0.5: string;
|
|
1507
|
+
};
|
|
1462
1508
|
keyframes: {
|
|
1463
1509
|
fadeIn: {
|
|
1464
1510
|
from: {
|
|
@@ -1592,16 +1638,7 @@ export declare type TextareaProps = ControlledProps | UncontrolledProps;
|
|
|
1592
1638
|
|
|
1593
1639
|
export declare const TextField: FC<TextFieldProps>;
|
|
1594
1640
|
|
|
1595
|
-
declare
|
|
1596
|
-
/** The type of the input field. Refers to and is a subset of the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#input_types" target="_blank">HTML input type attribute</a>. */
|
|
1597
|
-
type?: "text" | "email";
|
|
1598
|
-
/** If `true`, hides the clear icon button. */
|
|
1599
|
-
hideClear?: boolean;
|
|
1600
|
-
/** Any of valid mask types. We use <a href="https://imask.js.org/" target="_blank">IMask</a> behind the scenes. */
|
|
1601
|
-
mask?: string;
|
|
1602
|
-
/** If `true`, the input will return the unmasked/row value, instead of modified one. Will only have effect when `mask` is used. */
|
|
1603
|
-
unmask?: boolean;
|
|
1604
|
-
}
|
|
1641
|
+
declare type TextFieldBaseProps = DatelikeFieldBaseProps | RegularFieldBaseProps;
|
|
1605
1642
|
|
|
1606
1643
|
export declare type TextFieldProps = ControlledInputProps_5 | UncontrolledInputProps_5;
|
|
1607
1644
|
|
|
@@ -1746,11 +1783,11 @@ declare type UncontrolledInputProps_4 = BaseProps_12 & {
|
|
|
1746
1783
|
onChange?: (value: string) => void;
|
|
1747
1784
|
};
|
|
1748
1785
|
|
|
1749
|
-
declare
|
|
1786
|
+
declare type UncontrolledInputProps_5 = TextFieldBaseProps & {
|
|
1750
1787
|
value?: never;
|
|
1751
1788
|
defaultValue: string;
|
|
1752
1789
|
onChange?: (value: string) => void;
|
|
1753
|
-
}
|
|
1790
|
+
};
|
|
1754
1791
|
|
|
1755
1792
|
declare interface UncontrolledInputProps_6 extends BaseProps_13 {
|
|
1756
1793
|
value?: never;
|