@capillarytech/blaze-ui 0.3.3 → 1.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 +168 -65
- package/dist/CapAlert/CapAlert.d.ts +12 -0
- package/dist/CapAlert/CapAlert.d.ts.map +1 -0
- package/dist/CapAlert/CapAlert.test.d.ts +2 -0
- package/dist/CapAlert/CapAlert.test.d.ts.map +1 -0
- package/dist/CapAlert/index.d.ts +3 -0
- package/dist/CapAlert/index.d.ts.map +1 -0
- package/dist/CapAlert/index.js +696 -0
- package/dist/CapAlert/index.js.map +1 -0
- package/dist/CapButton/CapButton.d.ts +11 -0
- package/dist/CapButton/CapButton.d.ts.map +1 -0
- package/dist/CapButton/CapButton.test.d.ts +2 -0
- package/dist/CapButton/CapButton.test.d.ts.map +1 -0
- package/dist/CapButton/index.d.ts +3 -0
- package/dist/CapButton/index.d.ts.map +1 -0
- package/dist/CapButton/index.js +998 -0
- package/dist/CapButton/index.js.map +1 -0
- package/dist/CapCard/CapCard.d.ts +9 -0
- package/dist/CapCard/CapCard.d.ts.map +1 -0
- package/dist/CapCard/CapCard.test.d.ts +2 -0
- package/dist/CapCard/CapCard.test.d.ts.map +1 -0
- package/dist/CapCard/index.d.ts +3 -0
- package/dist/CapCard/index.d.ts.map +1 -0
- package/dist/CapCard/index.js +697 -0
- package/dist/CapCard/index.js.map +1 -0
- package/dist/CapCheckbox/CapCheckbox.d.ts +17 -0
- package/dist/CapCheckbox/CapCheckbox.d.ts.map +1 -0
- package/dist/CapCheckbox/CapCheckbox.test.d.ts +2 -0
- package/dist/CapCheckbox/CapCheckbox.test.d.ts.map +1 -0
- package/dist/CapCheckbox/index.d.ts +3 -0
- package/dist/CapCheckbox/index.d.ts.map +1 -0
- package/dist/CapCheckbox/index.js +917 -0
- package/dist/CapCheckbox/index.js.map +1 -0
- package/dist/CapColumn/CapColumn.d.ts +9 -0
- package/dist/CapColumn/CapColumn.d.ts.map +1 -0
- package/dist/CapColumn/CapColumn.test.d.ts +2 -0
- package/dist/CapColumn/CapColumn.test.d.ts.map +1 -0
- package/dist/CapColumn/index.d.ts +3 -0
- package/dist/CapColumn/index.d.ts.map +1 -0
- package/dist/CapColumn/index.js +694 -0
- package/dist/CapColumn/index.js.map +1 -0
- package/dist/CapDivider/CapDivider.d.ts +9 -0
- package/dist/CapDivider/CapDivider.d.ts.map +1 -0
- package/dist/CapDivider/CapDivider.test.d.ts +2 -0
- package/dist/CapDivider/CapDivider.test.d.ts.map +1 -0
- package/dist/CapDivider/index.d.ts +3 -0
- package/dist/CapDivider/index.d.ts.map +1 -0
- package/dist/CapDivider/index.js +696 -0
- package/dist/CapDivider/index.js.map +1 -0
- package/dist/CapDropdown/CapDropdown.d.ts +20 -0
- package/dist/CapDropdown/CapDropdown.d.ts.map +1 -0
- package/dist/CapDropdown/CapDropdown.test.d.ts +2 -0
- package/dist/CapDropdown/CapDropdown.test.d.ts.map +1 -0
- package/dist/CapDropdown/index.d.ts +3 -0
- package/dist/CapDropdown/index.d.ts.map +1 -0
- package/dist/CapDropdown/index.js +715 -0
- package/dist/CapDropdown/index.js.map +1 -0
- package/dist/CapForm/CapForm.d.ts +10 -0
- package/dist/CapForm/CapForm.d.ts.map +1 -0
- package/dist/CapForm/CapForm.test.d.ts +2 -0
- package/dist/CapForm/CapForm.test.d.ts.map +1 -0
- package/dist/CapForm/index.d.ts +3 -0
- package/dist/CapForm/index.d.ts.map +1 -0
- package/dist/CapForm/index.js +696 -0
- package/dist/CapForm/index.js.map +1 -0
- package/dist/CapFormItem/CapFormItem.d.ts +13 -0
- package/dist/CapFormItem/CapFormItem.d.ts.map +1 -0
- package/dist/CapFormItem/CapFormItem.test.d.ts +2 -0
- package/dist/CapFormItem/CapFormItem.test.d.ts.map +1 -0
- package/dist/CapFormItem/index.d.ts +3 -0
- package/dist/CapFormItem/index.d.ts.map +1 -0
- package/dist/CapFormItem/index.js +697 -0
- package/dist/CapFormItem/index.js.map +1 -0
- package/dist/CapIcon/CapIcon.d.ts +31 -0
- package/dist/CapIcon/CapIcon.d.ts.map +1 -0
- package/dist/CapIcon/CapIcon.test.d.ts +2 -0
- package/dist/CapIcon/CapIcon.test.d.ts.map +1 -0
- package/dist/CapIcon/index.d.ts +3 -0
- package/dist/CapIcon/index.d.ts.map +1 -0
- package/dist/CapIcon/index.js +853 -0
- package/dist/CapIcon/index.js.map +1 -0
- package/dist/CapInput/CapInput.d.ts +11 -0
- package/dist/CapInput/CapInput.d.ts.map +1 -0
- package/dist/CapInput/CapInput.test.d.ts +2 -0
- package/dist/CapInput/CapInput.test.d.ts.map +1 -0
- package/dist/CapInput/Number.d.ts +9 -0
- package/dist/CapInput/Number.d.ts.map +1 -0
- package/dist/CapInput/Number.test.d.ts +2 -0
- package/dist/CapInput/Number.test.d.ts.map +1 -0
- package/dist/CapInput/Search.d.ts +9 -0
- package/dist/CapInput/Search.d.ts.map +1 -0
- package/dist/CapInput/Search.test.d.ts +2 -0
- package/dist/CapInput/Search.test.d.ts.map +1 -0
- package/dist/CapInput/TextArea.d.ts +9 -0
- package/dist/CapInput/TextArea.d.ts.map +1 -0
- package/dist/CapInput/TextArea.test.d.ts +2 -0
- package/dist/CapInput/TextArea.test.d.ts.map +1 -0
- package/dist/CapInput/index.d.ts +9 -0
- package/dist/CapInput/index.d.ts.map +1 -0
- package/dist/CapInput/index.js +744 -0
- package/dist/CapInput/index.js.map +1 -0
- package/dist/CapLabel/CapLabel.d.ts +23 -0
- package/dist/CapLabel/CapLabel.d.ts.map +1 -0
- package/dist/CapLabel/CapLabel.test.d.ts +2 -0
- package/dist/CapLabel/CapLabel.test.d.ts.map +1 -0
- package/dist/CapLabel/index.d.ts +3 -0
- package/dist/CapLabel/index.d.ts.map +1 -0
- package/dist/CapLabel/index.js +760 -0
- package/dist/CapLabel/index.js.map +1 -0
- package/dist/CapMenu/CapMenu.d.ts +27 -0
- package/dist/CapMenu/CapMenu.d.ts.map +1 -0
- package/dist/CapMenu/CapMenu.test.d.ts +2 -0
- package/dist/CapMenu/CapMenu.test.d.ts.map +1 -0
- package/dist/CapMenu/index.d.ts +3 -0
- package/dist/CapMenu/index.d.ts.map +1 -0
- package/dist/CapMenu/index.js +716 -0
- package/dist/CapMenu/index.js.map +1 -0
- package/dist/CapRadio/CapRadio.d.ts +18 -0
- package/dist/CapRadio/CapRadio.d.ts.map +1 -0
- package/dist/CapRadio/CapRadio.test.d.ts +2 -0
- package/dist/CapRadio/CapRadio.test.d.ts.map +1 -0
- package/dist/CapRadio/index.d.ts +3 -0
- package/dist/CapRadio/index.d.ts.map +1 -0
- package/dist/CapRadio/index.js +918 -0
- package/dist/CapRadio/index.js.map +1 -0
- package/dist/CapRow/CapRow.d.ts +27 -0
- package/dist/CapRow/CapRow.d.ts.map +1 -0
- package/dist/CapRow/CapRow.test.d.ts +2 -0
- package/dist/CapRow/CapRow.test.d.ts.map +1 -0
- package/dist/CapRow/index.d.ts +3 -0
- package/dist/CapRow/index.d.ts.map +1 -0
- package/dist/CapRow/index.js +751 -0
- package/dist/CapRow/index.js.map +1 -0
- package/dist/CapSkeleton/CapSkeleton.d.ts +8 -0
- package/dist/CapSkeleton/CapSkeleton.d.ts.map +1 -0
- package/dist/CapSkeleton/CapSkeleton.test.d.ts +2 -0
- package/dist/CapSkeleton/CapSkeleton.test.d.ts.map +1 -0
- package/dist/CapSkeleton/index.d.ts +3 -0
- package/dist/CapSkeleton/index.d.ts.map +1 -0
- package/dist/CapSkeleton/index.js +124 -0
- package/dist/CapSkeleton/index.js.map +1 -0
- package/dist/CapSpin/CapSpin.d.ts +8 -0
- package/dist/CapSpin/CapSpin.d.ts.map +1 -0
- package/dist/CapSpin/CapSpin.test.d.ts +2 -0
- package/dist/CapSpin/CapSpin.test.d.ts.map +1 -0
- package/dist/CapSpin/index.d.ts +3 -0
- package/dist/CapSpin/index.d.ts.map +1 -0
- package/dist/CapSpin/index.js +123 -0
- package/dist/CapSpin/index.js.map +1 -0
- package/dist/CapSwitch/CapSwitch.d.ts +12 -0
- package/dist/CapSwitch/CapSwitch.d.ts.map +1 -0
- package/dist/CapSwitch/CapSwitch.test.d.ts +2 -0
- package/dist/CapSwitch/CapSwitch.test.d.ts.map +1 -0
- package/dist/CapSwitch/index.d.ts +3 -0
- package/dist/CapSwitch/index.d.ts.map +1 -0
- package/dist/CapSwitch/index.js +700 -0
- package/dist/CapSwitch/index.js.map +1 -0
- package/dist/CapTab/CapTab.d.ts +21 -0
- package/dist/CapTab/CapTab.d.ts.map +1 -0
- package/dist/CapTab/CapTab.test.d.ts +2 -0
- package/dist/CapTab/CapTab.test.d.ts.map +1 -0
- package/dist/CapTab/index.d.ts +3 -0
- package/dist/CapTab/index.d.ts.map +1 -0
- package/dist/CapTab/index.js +729 -0
- package/dist/CapTab/index.js.map +1 -0
- package/dist/CapTable/CapTable.d.ts +27 -0
- package/dist/CapTable/CapTable.d.ts.map +1 -0
- package/dist/CapTable/CapTable.test.d.ts +2 -0
- package/dist/CapTable/CapTable.test.d.ts.map +1 -0
- package/dist/CapTable/index.d.ts +3 -0
- package/dist/CapTable/index.d.ts.map +1 -0
- package/dist/CapTable/index.js +18315 -0
- package/dist/CapTable/index.js.map +1 -0
- package/dist/CapTable/loadable.d.ts +5 -0
- package/dist/CapTable/loadable.d.ts.map +1 -0
- package/dist/CapTable/loadable.test.d.ts +2 -0
- package/dist/CapTable/loadable.test.d.ts.map +1 -0
- package/dist/CapTestSelect/CapTestSelect.d.ts +24 -0
- package/dist/CapTestSelect/CapTestSelect.d.ts.map +1 -0
- package/dist/CapTestSelect/CapTestSelect.test.d.ts +2 -0
- package/dist/CapTestSelect/CapTestSelect.test.d.ts.map +1 -0
- package/dist/CapTestSelect/index.d.ts +3 -0
- package/dist/CapTestSelect/index.d.ts.map +1 -0
- package/dist/CapTestSelect/index.js +130 -0
- package/dist/CapTestSelect/index.js.map +1 -0
- package/dist/CapTooltip/CapTooltip.d.ts +10 -0
- package/dist/CapTooltip/CapTooltip.d.ts.map +1 -0
- package/dist/CapTooltip/CapTooltip.test.d.ts +2 -0
- package/dist/CapTooltip/CapTooltip.test.d.ts.map +1 -0
- package/dist/CapTooltip/index.d.ts +3 -0
- package/dist/CapTooltip/index.d.ts.map +1 -0
- package/dist/CapTooltip/index.js +730 -0
- package/dist/CapTooltip/index.js.map +1 -0
- package/dist/CapTooltipWithInfo/CapTooltipWithInfo.d.ts +18 -0
- package/dist/CapTooltipWithInfo/CapTooltipWithInfo.d.ts.map +1 -0
- package/dist/CapTooltipWithInfo/CapTooltipWithInfo.test.d.ts +2 -0
- package/dist/CapTooltipWithInfo/CapTooltipWithInfo.test.d.ts.map +1 -0
- package/dist/CapTooltipWithInfo/index.d.ts +3 -0
- package/dist/CapTooltipWithInfo/index.d.ts.map +1 -0
- package/dist/CapTooltipWithInfo/index.js +1156 -0
- package/dist/CapTooltipWithInfo/index.js.map +1 -0
- package/dist/CapUnifiedSelect/CapUnifiedSelect.d.ts +52 -0
- package/dist/CapUnifiedSelect/CapUnifiedSelect.d.ts.map +1 -0
- package/dist/CapUnifiedSelect/CapUnifiedSelect.test.d.ts +2 -0
- package/dist/CapUnifiedSelect/CapUnifiedSelect.test.d.ts.map +1 -0
- package/dist/CapUnifiedSelect/index.d.ts +3 -0
- package/dist/CapUnifiedSelect/index.d.ts.map +1 -0
- package/dist/CapUnifiedSelect/index.js +2092 -0
- package/dist/CapUnifiedSelect/index.js.map +1 -0
- package/dist/CapUnifiedSelect/messages.d.ts +24 -0
- package/dist/CapUnifiedSelect/messages.d.ts.map +1 -0
- package/dist/LocaleHoc/index.d.ts +9 -0
- package/dist/LocaleHoc/index.d.ts.map +1 -0
- package/{translations/en.js → dist/LocaleHoc/index.js} +169 -35
- package/dist/LocaleHoc/index.js.map +1 -0
- package/dist/LocaleHoc/index.test.d.ts +2 -0
- package/dist/LocaleHoc/index.test.d.ts.map +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23022 -0
- package/dist/index.js.map +1 -0
- package/dist/styled/variables.d.ts +150 -0
- package/dist/styled/variables.d.ts.map +1 -0
- package/dist/styled/variables.scss +194 -0
- package/dist/utils/fonts.d.ts +49 -0
- package/dist/utils/fonts.d.ts.map +1 -0
- package/dist/utils/fonts.test.d.ts +2 -0
- package/dist/utils/fonts.test.d.ts.map +1 -0
- package/dist/utils/index.d.ts +44 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +1147 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/styles.d.ts +19 -0
- package/dist/utils/styles.d.ts.map +1 -0
- package/package.json +263 -20
- package/CapIcon/CapIcon.js +0 -183
- package/CapIcon/index.js +0 -3
- package/CapIcon/styles.js +0 -76
- package/CapInput/CapInput.js +0 -67
- package/CapInput/Number.js +0 -38
- package/CapInput/Search.js +0 -32
- package/CapInput/TextArea.js +0 -45
- package/CapInput/index.js +0 -10
- package/CapInput/messages.js +0 -27
- package/CapInput/styles.js +0 -81
- package/CapLabel/CapLabel.js +0 -83
- package/CapLabel/index.js +0 -3
- package/CapLabel/styles.js +0 -259
- package/CapRow/CapRow.js +0 -123
- package/CapRow/index.js +0 -3
- package/CapRow/styles.js +0 -50
- package/CapSkeleton/CapSkeleton.js +0 -17
- package/CapSkeleton/index.js +0 -1
- package/CapSpin/CapSpin.js +0 -23
- package/CapSpin/index.js +0 -1
- package/CapTable/CapTable.js +0 -146
- package/CapTable/index.js +0 -3
- package/CapTable/loadable.js +0 -13
- package/CapTable/styles.js +0 -134
- package/CapTestSelect/CapTestSelect.js +0 -47
- package/CapTestSelect/index.js +0 -1
- package/CapTooltip/CapTooltip.js +0 -98
- package/CapTooltip/index.js +0 -3
- package/CapTooltip/styles.js +0 -34
- package/CapTooltipWithInfo/CapTooltipWithInfo.js +0 -74
- package/CapTooltipWithInfo/index.js +0 -3
- package/CapTooltipWithInfo/styles.js +0 -22
- package/CapUnifiedSelect/CapUnifiedSelect.js +0 -541
- package/CapUnifiedSelect/index.js +0 -1
- package/CapUnifiedSelect/messages.js +0 -24
- package/CapUnifiedSelect/styles.js +0 -441
- package/LocaleHoc/index.js +0 -38
- package/index.js +0 -21
- package/styled/index.js +0 -6
- package/styled/variables.js +0 -91
- package/utils/index.js +0 -1
- package/utils/withMemo.js +0 -33
- package/utils/withStyles.js +0 -24
- /package/{assets → dist/assets}/upload.svg +0 -0
package/README.md
CHANGED
|
@@ -112,9 +112,9 @@ A modern React component library built with Ant Design v5, providing enhanced UI
|
|
|
112
112
|
|
|
113
113
|
- 🎨 Built on top of Ant Design v5
|
|
114
114
|
- 📦 Tree-shakeable ES modules
|
|
115
|
-
- 🎯 TypeScript support
|
|
115
|
+
- 🎯 Full TypeScript support with type definitions
|
|
116
116
|
- 🌐 Internationalization ready
|
|
117
|
-
- 💅 Styled with
|
|
117
|
+
- 💅 Styled with SCSS and CSS Modules
|
|
118
118
|
- ⚡ Optimized bundle size
|
|
119
119
|
|
|
120
120
|
## Installation
|
|
@@ -131,8 +131,28 @@ yarn add @capillarytech/blaze-ui
|
|
|
131
131
|
|
|
132
132
|
## Usage
|
|
133
133
|
|
|
134
|
+
### Setup
|
|
135
|
+
|
|
136
|
+
Load fonts and base styles in your application entry point:
|
|
137
|
+
|
|
134
138
|
```jsx
|
|
135
|
-
import {
|
|
139
|
+
import { loadBlazeUI } from '@capillarytech/blaze-ui/utils';
|
|
140
|
+
|
|
141
|
+
// Load fonts (Roboto, Material Icons) and base styles (sanitize.css)
|
|
142
|
+
loadBlazeUI();
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Note:** If your app already imports `sanitize.css` directly, webpack will deduplicate it if both resolve to the same module path. To avoid duplication, you can load fonts separately:
|
|
146
|
+
|
|
147
|
+
```jsx
|
|
148
|
+
import { loadBlazeUIFonts } from '@capillarytech/blaze-ui/utils';
|
|
149
|
+
loadBlazeUIFonts();
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Using Components
|
|
153
|
+
|
|
154
|
+
```jsx
|
|
155
|
+
import { CapInput, CapInputSearch, CapInputTextArea, CapInputNumber } from '@capillarytech/blaze-ui';
|
|
136
156
|
|
|
137
157
|
function MyComponent() {
|
|
138
158
|
return (
|
|
@@ -145,83 +165,77 @@ function MyComponent() {
|
|
|
145
165
|
}
|
|
146
166
|
```
|
|
147
167
|
|
|
148
|
-
## Components
|
|
149
|
-
|
|
150
|
-
### CapInput
|
|
168
|
+
## Exploring Components
|
|
151
169
|
|
|
152
|
-
|
|
170
|
+
To explore all available components and their usage examples, run Storybook locally:
|
|
153
171
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
<CapInput
|
|
157
|
-
placeholder="Enter text"
|
|
158
|
-
value={value}
|
|
159
|
-
onChange={(e) => setValue(e.target.value)}
|
|
160
|
-
/>
|
|
172
|
+
```bash
|
|
173
|
+
npm start
|
|
161
174
|
```
|
|
162
175
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
value={email}
|
|
169
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
170
|
-
/>
|
|
171
|
-
```
|
|
176
|
+
This will start the Storybook development server at `http://localhost:6006`, where you can:
|
|
177
|
+
- Browse all available components
|
|
178
|
+
- View interactive examples
|
|
179
|
+
- Test different props and configurations
|
|
180
|
+
- See component documentation and API reference
|
|
172
181
|
|
|
173
|
-
|
|
174
|
-
```jsx
|
|
175
|
-
<CapInput
|
|
176
|
-
placeholder="Username"
|
|
177
|
-
isVerified={true}
|
|
178
|
-
value={username}
|
|
179
|
-
onChange={(e) => setUsername(e.target.value)}
|
|
180
|
-
/>
|
|
181
|
-
```
|
|
182
|
+
## Styling
|
|
182
183
|
|
|
183
|
-
|
|
184
|
-
```jsx
|
|
185
|
-
<CapInput.Search
|
|
186
|
-
placeholder="Search..."
|
|
187
|
-
enterButton="Search"
|
|
188
|
-
onSearch={(value) => handleSearch(value)}
|
|
189
|
-
/>
|
|
190
|
-
```
|
|
184
|
+
The library uses CSS Modules with SCSS and automatically embeds styles in the JavaScript bundle. No separate CSS imports are needed - styles are automatically injected when you import components.
|
|
191
185
|
|
|
192
|
-
|
|
193
|
-
```jsx
|
|
194
|
-
<CapInput.TextArea
|
|
195
|
-
placeholder="Enter description"
|
|
196
|
-
rows={4}
|
|
197
|
-
showCount
|
|
198
|
-
maxLength={500}
|
|
199
|
-
/>
|
|
200
|
-
```
|
|
186
|
+
### Using Design Tokens and Variables
|
|
201
187
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
188
|
+
Blaze UI provides a comprehensive set of design tokens (colors, spacing, typography, etc.) in the `styled` folder that you can use in your application to maintain consistency with the component library.
|
|
189
|
+
|
|
190
|
+
#### For SCSS/SASS Projects
|
|
191
|
+
|
|
192
|
+
Import the SCSS variables file (`styled/variables.scss`) in your stylesheets:
|
|
193
|
+
|
|
194
|
+
```scss
|
|
195
|
+
// Import SCSS variables
|
|
196
|
+
@import '@capillarytech/blaze-ui/styled/variables.scss';
|
|
197
|
+
|
|
198
|
+
.my-component {
|
|
199
|
+
color: $cap-primary-base;
|
|
200
|
+
background-color: $cap-g09;
|
|
201
|
+
padding: $cap-spacing-md;
|
|
202
|
+
border-radius: $cap-border-radius-base;
|
|
203
|
+
font-size: $cap-font-size-base;
|
|
204
|
+
}
|
|
210
205
|
```
|
|
211
206
|
|
|
212
|
-
|
|
207
|
+
**Available SCSS Variables:**
|
|
208
|
+
- **Colors:** `$cap-primary-base`, `$cap-secondary-base`, `$cap-orange`, `$cap-blue`, `$cap-red`, etc.
|
|
209
|
+
- **Grey Scale:** `$cap-g01` through `$cap-g10`
|
|
210
|
+
- **Spacing:** `$cap-spacing-xs`, `$cap-spacing-sm`, `$cap-spacing-md`, `$cap-spacing-lg`, `$cap-spacing-xl`
|
|
211
|
+
- **Typography:** `$cap-font-size-base`, `$cap-line-height-base`, `$cap-font-weight-regular`, `$cap-font-weight-medium`, `$cap-font-weight-bold`
|
|
212
|
+
- **Border Radius:** `$cap-border-radius-sm`, `$cap-border-radius-base`, `$cap-border-radius-lg`
|
|
213
|
+
- **Shadows:** `$cap-box-shadow-base`, `$cap-box-shadow-card`
|
|
213
214
|
|
|
214
|
-
|
|
215
|
+
#### For Styled-Components/CSS-in-JS Projects
|
|
215
216
|
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
Import TypeScript variables (`styled/variables.ts`) in your JavaScript/TypeScript files:
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
import * as vars from '@capillarytech/blaze-ui/styled/variables';
|
|
221
|
+
import styled from 'styled-components';
|
|
218
222
|
|
|
219
|
-
const
|
|
220
|
-
color: ${
|
|
221
|
-
|
|
223
|
+
const MyComponent = styled.div`
|
|
224
|
+
color: ${vars.CAP_PRIMARY.base};
|
|
225
|
+
background-color: ${vars.CAP_G09};
|
|
226
|
+
padding: ${vars.CAP_SPACING_MD};
|
|
227
|
+
border-radius: ${vars.CAP_BORDER_RADIUS_BASE};
|
|
222
228
|
`;
|
|
223
229
|
```
|
|
224
230
|
|
|
231
|
+
**Available TypeScript Exports:**
|
|
232
|
+
- **Colors:** `CAP_PRIMARY`, `CAP_SECONDARY`, `CAP_ORANGE`, `CAP_BLUE`, `CAP_RED`, etc.
|
|
233
|
+
- **Grey Scale:** `CAP_G01` through `CAP_G10`
|
|
234
|
+
- **Spacing:** `CAP_SPACING_XS`, `CAP_SPACING_SM`, `CAP_SPACING_MD`, `CAP_SPACING_LG`, `CAP_SPACING_XL`
|
|
235
|
+
- **Typography:** `CAP_FONT_SIZE_BASE`, `CAP_LINE_HEIGHT_BASE`, `CAP_FONT_WEIGHT_REGULAR`, `CAP_FONT_WEIGHT_MEDIUM`, `CAP_FONT_WEIGHT_BOLD`
|
|
236
|
+
- **Border Radius:** `CAP_BORDER_RADIUS_SM`, `CAP_BORDER_RADIUS_BASE`, `CAP_BORDER_RADIUS_LG`
|
|
237
|
+
- **Shadows:** `CAP_BOX_SHADOW_BASE`, `CAP_BOX_SHADOW_CARD`
|
|
238
|
+
|
|
225
239
|
## Development
|
|
226
240
|
|
|
227
241
|
### Setup
|
|
@@ -230,9 +244,32 @@ npm install
|
|
|
230
244
|
```
|
|
231
245
|
|
|
232
246
|
### Build
|
|
247
|
+
|
|
248
|
+
#### Standard Build (for development)
|
|
233
249
|
```bash
|
|
234
250
|
npm run build
|
|
235
251
|
```
|
|
252
|
+
This builds the library without generating the exports field. Use this for regular development builds.
|
|
253
|
+
|
|
254
|
+
#### Build for Local Testing
|
|
255
|
+
```bash
|
|
256
|
+
npm run build:local
|
|
257
|
+
```
|
|
258
|
+
This builds the library with exports field generation. Use this when you want to test the library locally in a consuming application using `npm run link`.
|
|
259
|
+
|
|
260
|
+
**Example workflow for local testing:**
|
|
261
|
+
```bash
|
|
262
|
+
# In blaze-ui directory
|
|
263
|
+
npm run build:local
|
|
264
|
+
npm run link
|
|
265
|
+
|
|
266
|
+
# In your consuming app directory
|
|
267
|
+
npm link @capillarytech/blaze-ui
|
|
268
|
+
|
|
269
|
+
# Now you can test the library in your app
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Note:** Remember to run `node scripts/remove-exports.js` after testing to clean up the exports field from package.json.
|
|
236
273
|
|
|
237
274
|
### Development Mode
|
|
238
275
|
```bash
|
|
@@ -250,13 +287,79 @@ npm run lint:fix
|
|
|
250
287
|
npm run prettier
|
|
251
288
|
```
|
|
252
289
|
|
|
290
|
+
## Publishing a New Version
|
|
291
|
+
|
|
292
|
+
The library uses an automated publishing script to manage versioning and deployment to NPM.
|
|
293
|
+
|
|
294
|
+
### Prerequisites
|
|
295
|
+
|
|
296
|
+
- Ensure you have write permissions to the NPM package `@capillarytech/blaze-ui`
|
|
297
|
+
- Ensure you're authenticated with NPM (`npm login`)
|
|
298
|
+
- Make sure all changes are committed and pushed to the repository
|
|
299
|
+
|
|
300
|
+
### Version Types
|
|
301
|
+
|
|
302
|
+
The library supports different version types based on semantic versioning:
|
|
303
|
+
|
|
304
|
+
#### Production Releases
|
|
305
|
+
- **major**: Breaking changes (e.g., 1.0.0 → 2.0.0)
|
|
306
|
+
- **minor**: New features, backwards compatible (e.g., 1.0.0 → 1.1.0)
|
|
307
|
+
- **patch**: Bug fixes, backwards compatible (e.g., 1.0.0 → 1.0.1)
|
|
308
|
+
|
|
309
|
+
#### Pre-releases
|
|
310
|
+
- **alpha**: Early testing releases (e.g., 1.0.0 → 1.0.1-alpha.0)
|
|
311
|
+
- **beta**: Feature complete, testing releases (e.g., 1.0.0 → 1.0.1-beta.0)
|
|
312
|
+
|
|
313
|
+
### Publishing Steps
|
|
314
|
+
|
|
315
|
+
Run the publish script with the desired version type:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
# For production releases
|
|
319
|
+
bash scripts/publish.sh major # Breaking changes
|
|
320
|
+
bash scripts/publish.sh minor # New features
|
|
321
|
+
bash scripts/publish.sh patch # Bug fixes
|
|
322
|
+
|
|
323
|
+
# For pre-releases
|
|
324
|
+
bash scripts/publish.sh alpha # Alpha release
|
|
325
|
+
bash scripts/publish.sh beta # Beta release
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### What the Script Does
|
|
329
|
+
|
|
330
|
+
The publish script automatically handles:
|
|
331
|
+
|
|
332
|
+
1. **Version Bump**: Updates the version in `package.json` based on the specified type
|
|
333
|
+
2. **Exports Generation**: Generates the exports field for proper module resolution
|
|
334
|
+
3. **Build**: Cleans and rebuilds the library
|
|
335
|
+
- Runs webpack build
|
|
336
|
+
- Generates TypeScript type definitions
|
|
337
|
+
4. **Publish**: Publishes to NPM with the appropriate tag
|
|
338
|
+
- `latest` tag for production releases (major/minor/patch)
|
|
339
|
+
- `alpha` or `beta` tags for pre-releases
|
|
340
|
+
5. **Cleanup**: Removes the exports field from `package.json`
|
|
341
|
+
6. **Git Tags**: Pushes version tags to the repository
|
|
342
|
+
|
|
343
|
+
### Example Workflow
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
# Publishing a new feature
|
|
347
|
+
bash scripts/publish.sh minor
|
|
348
|
+
|
|
349
|
+
# Publishing a bug fix
|
|
350
|
+
bash scripts/publish.sh patch
|
|
351
|
+
|
|
352
|
+
# Publishing a beta version for testing
|
|
353
|
+
bash scripts/publish.sh beta
|
|
354
|
+
```
|
|
355
|
+
|
|
253
356
|
## Migration from cap-ui-library
|
|
254
357
|
|
|
255
358
|
This library is designed as a modern replacement for `@capillarytech/cap-ui-library`, migrated from Ant Design v3 to v5. Key changes include:
|
|
256
359
|
|
|
257
360
|
1. **Updated Ant Design APIs**: All components now use Ant Design v5 APIs
|
|
258
361
|
2. **Modern React patterns**: Functional components with hooks instead of class components
|
|
259
|
-
3. **
|
|
362
|
+
3. **Full TypeScript support**: Complete type definitions for all components and utilities
|
|
260
363
|
4. **Better tree-shaking**: Optimized bundle size with proper ES modules
|
|
261
364
|
|
|
262
365
|
## Contributing
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CapAlertProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
type?: 'success' | 'info' | 'warning' | 'error';
|
|
5
|
+
message?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
showIcon?: boolean;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
declare const CapAlert: React.FC<CapAlertProps>;
|
|
11
|
+
export default CapAlert;
|
|
12
|
+
//# sourceMappingURL=CapAlert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CapAlert.d.ts","sourceRoot":"","sources":["../../components/CapAlert/CapAlert.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAIrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CapAlert.test.d.ts","sourceRoot":"","sources":["../../components/CapAlert/CapAlert.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapAlert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|