@caseparts-org/caseblocks 0.0.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/README.md +97 -0
- package/dist/Text.module-ruz24ug-.js +25 -0
- package/dist/assets/Account.css +1 -0
- package/dist/assets/Avatar.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Chip.css +1 -0
- package/dist/assets/ChipSelector.css +1 -0
- package/dist/assets/Flex.css +1 -0
- package/dist/assets/Flex2.css +1 -0
- package/dist/assets/Grid.css +1 -0
- package/dist/assets/HideAt.css +1 -0
- package/dist/assets/Icon.css +1 -0
- package/dist/assets/Link.css +1 -0
- package/dist/assets/Logo.css +1 -0
- package/dist/assets/MainNav.css +1 -0
- package/dist/assets/Root.css +1 -0
- package/dist/assets/SearchBox.css +1 -0
- package/dist/assets/Separator.css +1 -0
- package/dist/assets/Text.css +1 -0
- package/dist/assets/ToggleView.css +1 -0
- package/dist/atoms/Button/Button.d.ts +7 -0
- package/dist/atoms/Button/Button.js +45 -0
- package/dist/atoms/Button/Button.stories.d.ts +15 -0
- package/dist/atoms/Button/Button.stories.js +40 -0
- package/dist/atoms/Flex/Flex.d.ts +13 -0
- package/dist/atoms/Flex/Flex.js +35 -0
- package/dist/atoms/Flex/Flex.stories.d.ts +14 -0
- package/dist/atoms/Flex/Flex.stories.js +131 -0
- package/dist/atoms/Grid/Grid.d.ts +25 -0
- package/dist/atoms/Grid/Grid.js +40 -0
- package/dist/atoms/Grid/Grid.stories.d.ts +17 -0
- package/dist/atoms/Grid/Grid.stories.js +58 -0
- package/dist/atoms/HideAt.d.ts +9 -0
- package/dist/atoms/HideAt.js +15 -0
- package/dist/atoms/Icon/Icon.d.ts +8 -0
- package/dist/atoms/Icon/Icon.js +33 -0
- package/dist/atoms/Icon/Icon.stories.d.ts +14 -0
- package/dist/atoms/Icon/Icon.stories.js +28 -0
- package/dist/atoms/Link/Link.d.ts +7 -0
- package/dist/atoms/Link/Link.js +35 -0
- package/dist/atoms/Link/Link.stories.d.ts +13 -0
- package/dist/atoms/Link/Link.stories.js +21 -0
- package/dist/atoms/ResponsiveProp.d.ts +2 -0
- package/dist/atoms/ResponsiveProp.js +14 -0
- package/dist/atoms/Root/Head.d.ts +1 -0
- package/dist/atoms/Root/Head.js +13 -0
- package/dist/atoms/Root/Root.d.ts +4 -0
- package/dist/atoms/Root/Root.js +10 -0
- package/dist/atoms/Separator/Separator.d.ts +7 -0
- package/dist/atoms/Separator/Separator.js +30 -0
- package/dist/atoms/Separator/Separator.stories.d.ts +13 -0
- package/dist/atoms/Separator/Separator.stories.js +33 -0
- package/dist/atoms/Text/Text.d.ts +15 -0
- package/dist/atoms/Text/Text.js +32 -0
- package/dist/atoms/Text/Text.stories.d.ts +17 -0
- package/dist/atoms/Text/Text.stories.js +89 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/main.d.ts +29 -0
- package/dist/main.js +37 -0
- package/dist/molecules/Account/Account.d.ts +13 -0
- package/dist/molecules/Account/Account.js +66 -0
- package/dist/molecules/Account/Account.stories.d.ts +14 -0
- package/dist/molecules/Account/Account.stories.js +26 -0
- package/dist/molecules/Avatar/Avatar.d.ts +6 -0
- package/dist/molecules/Avatar/Avatar.js +35 -0
- package/dist/molecules/Avatar/Avatar.stories.d.ts +13 -0
- package/dist/molecules/Avatar/Avatar.stories.js +17 -0
- package/dist/molecules/Chip/Chip.d.ts +57 -0
- package/dist/molecules/Chip/Chip.js +71 -0
- package/dist/molecules/Chip/Chip.stories.d.ts +15 -0
- package/dist/molecules/Chip/Chip.stories.js +53 -0
- package/dist/molecules/Logo/Logo.d.ts +1 -0
- package/dist/molecules/Logo/Logo.js +53 -0
- package/dist/molecules/Logo/Logo.stories.d.ts +13 -0
- package/dist/molecules/Logo/Logo.stories.js +17 -0
- package/dist/molecules/SearchBox/SearchBox.d.ts +6 -0
- package/dist/molecules/SearchBox/SearchBox.js +60 -0
- package/dist/molecules/SearchBox/SearchBox.stories.d.ts +12 -0
- package/dist/molecules/SearchBox/SearchBox.stories.js +15 -0
- package/dist/molecules/ToggleView/ToggleView.d.ts +75 -0
- package/dist/molecules/ToggleView/ToggleView.js +102 -0
- package/dist/molecules/ToggleView/ToggleView.stories.d.ts +13 -0
- package/dist/molecules/ToggleView/ToggleView.stories.js +24 -0
- package/dist/organisms/ChipSelector/ChipSelector.d.ts +12 -0
- package/dist/organisms/ChipSelector/ChipSelector.js +43 -0
- package/dist/organisms/ChipSelector/ChipSelector.stories.d.ts +14 -0
- package/dist/organisms/ChipSelector/ChipSelector.stories.js +51 -0
- package/dist/organisms/MainNav/MainNav.d.ts +4 -0
- package/dist/organisms/MainNav/MainNav.js +103 -0
- package/dist/organisms/MainNav/MainNav.stories.d.ts +13 -0
- package/dist/organisms/MainNav/MainNav.stories.js +24 -0
- package/dist/styles/tokens.css +243 -0
- package/package.json +73 -0
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Introduction
|
|
2
|
+
|
|
3
|
+
This is CaseBlocks, the component library for Case Parts.
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
1. `npm install` to install dependencies.
|
|
8
|
+
2. `npm run build` to build component library.
|
|
9
|
+
|
|
10
|
+
## Local Development
|
|
11
|
+
|
|
12
|
+
### Storybook
|
|
13
|
+
|
|
14
|
+
Use Storybook to view components in an interactive environment when building them.
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
npm run storybook
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Link to this library locally
|
|
21
|
+
|
|
22
|
+
This library can be linked from another project, to see local changes to the component libary in a real app.
|
|
23
|
+
|
|
24
|
+
There are two ways to link locally. In both cases, a symlink is created between the consuming project and _the build artifacts_ of this component library. When making changes in this library, you'll need to run `npm run build` in order for the consuming project to obtain the changes.
|
|
25
|
+
|
|
26
|
+
1. Install this library via file path.
|
|
27
|
+
|
|
28
|
+
In the consuming project, install using the relative path to this project, for example:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
npm install ../CaseBlocks
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
In the consumer project, you should see a dependency added in the `package.json` like this:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"case-blocks": "file:../CaseBlocks",
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
1. `npm link`.
|
|
42
|
+
|
|
43
|
+
This method requires two steps: adding this library to a registry of linkable projects, and then linking to this library from the consuming project.
|
|
44
|
+
|
|
45
|
+
In this folder, register this library for linking:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
npm link
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then in the consuming project, link to this project:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
npm link case-blocks
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
This will not affect the consuming project's `package.json` file.
|
|
58
|
+
|
|
59
|
+
If you wish to unlink the consuming project from this library, use `npm unlink case-blocks`.
|
|
60
|
+
|
|
61
|
+
## Using Design Tokens
|
|
62
|
+
|
|
63
|
+
The `tokens.css` file contains design tokens exported from Figma and is available for use in your projects. To use it, follow the steps below:
|
|
64
|
+
|
|
65
|
+
### Importing the Tokens
|
|
66
|
+
|
|
67
|
+
1. **In a CSS File**
|
|
68
|
+
Add the following import to your global CSS file:
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
@import "case-blocks/styles/tokens.css";
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
2. **In a JavaScript/TypeScript File**
|
|
75
|
+
Import the tokens in your entry point (e.g., `App.jsx`):
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
import "case-blocks/styles/tokens.css";
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Accessing the Tokens
|
|
82
|
+
|
|
83
|
+
Once imported, you can use the CSS variables defined in `tokens.css` throughout your project. For example:
|
|
84
|
+
|
|
85
|
+
```css
|
|
86
|
+
button {
|
|
87
|
+
background-color: var(--color-brand-primary-primary-teal-blue);
|
|
88
|
+
color: var(--color-brand-primary-white);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
CSS IntelliSense: Use an extension like 'CSS Variable Autocomplete' for better IntelliSense and easier access to design tokens.
|
|
93
|
+
|
|
94
|
+
### Notes
|
|
95
|
+
|
|
96
|
+
- Ensure you run `npm run build` in this library to generate the `tokens.css` file in the `dist/styles` folder before using it in a consumer project.
|
|
97
|
+
- If linking this library locally, rebuild after making changes to ensure the latest tokens are available.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import './assets/Text.css';const t = {
|
|
2
|
+
"text-body": "_text-body_dp585_1",
|
|
3
|
+
"text-display": "_text-display_dp585_7",
|
|
4
|
+
"text-xxs": "_text-xxs_dp585_15",
|
|
5
|
+
"text-xs": "_text-xs_dp585_23",
|
|
6
|
+
"text-sm": "_text-sm_dp585_31",
|
|
7
|
+
"text-md": "_text-md_dp585_39",
|
|
8
|
+
"text-lg": "_text-lg_dp585_47",
|
|
9
|
+
"text-xl": "_text-xl_dp585_55",
|
|
10
|
+
"text-2xl": "_text-2xl_dp585_63",
|
|
11
|
+
"text-3xl": "_text-3xl_dp585_71",
|
|
12
|
+
"text-4xl": "_text-4xl_dp585_79",
|
|
13
|
+
"text-5xl": "_text-5xl_dp585_87",
|
|
14
|
+
"text-6xl": "_text-6xl_dp585_95",
|
|
15
|
+
"text-thin": "_text-thin_dp585_105",
|
|
16
|
+
"text-extra-light": "_text-extra-light_dp585_111",
|
|
17
|
+
"text-light": "_text-light_dp585_117",
|
|
18
|
+
"text-regular": "_text-regular_dp585_123",
|
|
19
|
+
"text-medium": "_text-medium_dp585_129",
|
|
20
|
+
"text-semibold": "_text-semibold_dp585_135",
|
|
21
|
+
"text-bold": "_text-bold_dp585_141"
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
t
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._loggedIn_14vhg_1{flex-shrink:0;gap:var(--spacing-1-25)}._customer_14vhg_9{gap:var(--spacing-0-125)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._avatar_18kx8_1{margin:3px;position:relative;background-color:var(--icons-icon-secondary);color:var(--text-text-invert);flex-shrink:0;border-radius:50%;width:26px;height:26px;text-align:center;text-transform:"uppercase"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._button_1vql2_1{--inset-shadow-color: var(--surface-surface-primary-btn);--inset-shadow-style: 0 0 0, inset 0 0 0 var(--spacing-0-125) var(--inset-shadow-color);transition-property:background-color,border-width,box-shadow,color;transition-duration:.1s;transition-timing-function:ease-in;padding:var(--spacing-1);border:none;cursor:pointer}._button_1vql2_1:hover{box-shadow:var(--color-neutrals-neutral-2) var(--spacing-0-125) var(--spacing-0-25) var(--spacing-0-5)}._button_1vql2_1:active{box-shadow:none}._button_1vql2_1:disabled{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert);transition:none;cursor:default}._button_1vql2_1:disabled:hover{box-shadow:none}._button-primary_1vql2_71{background-color:var(--surface-surface-primary-btn);color:var(--surface-surface-primary)}._button-primary_1vql2_71:active{background-color:var(--color-brand-secondary-dark-teal-blue)}._button-primary_1vql2_71:active:disabled{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert)}._button-secondary_1vql2_99{background-color:var(--surface-surface-secondary-btn);border:1px solid var(--border-border-secondary-btn);color:var(--text-text-links)}._button-secondary_1vql2_99:active{--inset-shadow-color: var(--surface-surface-secondary);box-shadow:var(--inset-shadow-style)}._button-secondary_1vql2_99:disabled{background-color:var(--surface-surface-disabled-btn-focus);color:var(--surface-surface-disabled-btn);--inset-shadow-color: var(--surface-surface-disabled-btn);box-shadow:var(--inset-shadow-style)}._button-secondary_1vql2_99:disabled:hover{box-shadow:var(--inset-shadow-style)}._button-cta-primary_1vql2_143{background-color:var(--surface-surface-call-to-action-btn);color:var(--surface-surface-primary)}._button-cta-primary_1vql2_143:active{background-color:var(--surface-surface-call-to-action-btn-focus)}._button-cta-primary_1vql2_143:active:disabled{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert)}._button-tertiary_1vql2_171{background-color:var(--surface-surface-tertiary-btn);color:var(--surface-surface-tertiary-btn-focus)}._button-tertiary_1vql2_171:active{color:var(--surface-surface-disabled-btn);background-color:var(--surface-surface-tertiary-btn-focus);--inset-shadow-color: var(--surface-surface-disabled-btn);box-shadow:var(--inset-shadow-style)}._button-tertiary_1vql2_171:active:disabled{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert)}._button-destructive_1vql2_207{background-color:var(--surface-surface-error-warning-btn);color:var(--surface-surface-primary)}._button-destructive_1vql2_207:active{color:var(--surface-surface-error-warning-btn);background-color:var(--surface-surface-tertiary-btn-focus);--inset-shadow-color: var(--border-border-error-warning);box-shadow:var(--inset-shadow-style)}._button-destructive_1vql2_207:active:disabled{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert)}._button-size-xs_1vql2_243{border-radius:var(--border-radius-xs);padding:var(--spacing-spacing-3xs) var(--spacing-spacing-2xs)}._button-size-sm_1vql2_251{border-radius:var(--border-radius-sm);padding:var(--spacing-spacing-3xs) var(--spacing-0-75)}._button-size-md_1vql2_259,._button-size-lg_1vql2_267{border-radius:var(--border-radius-sm);padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default)}._button-size-xl_1vql2_275{border-radius:var(--border-radius-sm);padding:var(--spacing-0-75) var(--spacing-spacing-default)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._chip_mklpn_1{padding:var(--spacing-0-25) var(--spacing-0-5);border-radius:var(--radius-radius-minimal);border:none;width:fit-content;gap:var(--spacing-0-25);color:var(--text-text-invert)}._disabled_mklpn_10{background-color:var(--surface-surface-disabled-btn);cursor:not-allowed;pointer-events:none}._selected_mklpn_16{background-color:var(--surface-surface-primary-chit);cursor:pointer}._unselected_mklpn_21{background-color:var(--surface-surface-disabled-btn);cursor:pointer;color:var(--text-text-quaternary)}._dismissable_mklpn_27{background-color:var(--surface-surface-primary-chit)}._dismissButton_mklpn_31{padding:0;background-color:transparent;border:none;cursor:pointer}._dismissButton_mklpn_31 svg{padding:0;margin:0}._dismissButton_mklpn_31 path{fill:#fff}._pill_mklpn_47{border-radius:var(--border-radius-lg);background-color:var(--surface-surface-primary-chit)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._chipSelector_1k7dl_1{column-gap:var(--spacing-1);row-gap:var(--spacing-0-75);flex-wrap:wrap}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._flex_99eez_1{display:flex;flex-direction:var(--flex-direction-large);justify-content:var(--justify-content-large);align-items:var(--align-items-large)}@media (max-width: 1280px){._flex_99eez_1{flex-direction:var(--flex-direction-medium);justify-content:var(--justify-content-medium);align-items:var(--align-items-medium)}}@media (max-width: 767px){._flex_99eez_1{flex-direction:var(--flex-direction-small);justify-content:var(--justify-content-small);align-items:var(--align-items-small)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._flexWrapper_1jk8h_1{width:800px}@media (max-width: 1280px){._flexWrapper_1jk8h_1{width:600px}}@media (max-width: 767px){._flexWrapper_1jk8h_1{width:400px}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._grid_wn2h7_3{display:grid;grid-template-columns:repeat(12,1fr);gap:var(--spacing-2);width:100%;max-width:1440px;margin:0 auto}._column_wn2h7_21{min-width:0;width:100%;grid-column:var(--start-large, 1) / span var(--span-large)}@media (max-width: 1280px){._grid_wn2h7_3{max-width:100%}._column_wn2h7_21{grid-column:var(--start-medium, 1) / span var(--span-medium)}}@media (max-width: 767px){._grid_wn2h7_3{grid-template-columns:repeat(4,1fr)}._column_wn2h7_21{grid-column:var(--start-small, 1) / span var(--span-small)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@media (min-width: 1281px){._hideAt-lg_curbn_1.hide{display:none}}@media (min-width: 768px) and (max-width: 1280px){._hideAt-md_curbn_13.hide{display:none}}@media (max-width: 767px){._hideAt-sm_curbn_25.hide{display:none}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._icon-sm_flrgw_1{font-size:var(--font-size-md);margin:calc(var(--font-size-md) / 4)}._icon-md_flrgw_6{font-size:var(--font-size-2xl);margin:calc(var(--font-size-2xl) / 4)}._icon-lg_flrgw_11{font-size:var(--font-size-3xl);margin:calc(var(--font-size-3xl) / 4)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._link_6pq15_1{color:var(--text-text-links);text-decoration:none}._link_6pq15_1:hover{text-decoration:underline}._link_6pq15_1:focus{text-decoration:underline;font-weight:var(--font-weight-semibold)}._link_6pq15_1._disabled_6pq15_27{color:var(--text-text-disabled);cursor:not-allowed}._link_6pq15_1._disabled_6pq15_27:hover{text-decoration:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_16m6g_1{gap:var(--spacing-1);flex-shrink:0}._wordmark_16m6g_11{margin-bottom:var(--spacing-0-25)}._tagline_16m6g_19{color:var(--color-brand-primary-primary-black)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._logoAndSearch_3a8de_1{width:100%}._searchContainer_3a8de_7{margin-left:var(--spacing-3-5);margin-right:var(--spacing-1-5);width:100%}@media (max-width: 767px){._searchContainer_3a8de_7{margin-left:0;margin-top:var(--spacing-1)}}._menu_3a8de_25{flex-shrink:0}._chatIcon_3a8de_31{color:var(--color-alerts-success)}@media (min-width: 1281px){._chatIcon_3a8de_31{margin-right:var(--spacing-0-25)}}._siteLink_3a8de_43{margin-right:var(--spacing-2);color:var(--color-brand-primary-primary-black)}._accountId_3a8de_51{margin-bottom:var(--spacing-0-5)}@media (min-width: 768px){._menuIcon_3a8de_57{margin:0 var(--spacing-1-5)}}._separator_3a8de_67{margin:0 var(--spacing-1-5);align-self:stretch}
|