webcoreui 0.4.1 → 0.5.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.
Files changed (47) hide show
  1. package/README.md +230 -227
  2. package/astro.d.ts +6 -0
  3. package/astro.js +6 -0
  4. package/components/Avatar/Avatar.astro +9 -2
  5. package/components/Avatar/Avatar.svelte +3 -1
  6. package/components/Avatar/Avatar.tsx +4 -2
  7. package/components/Avatar/avatar.ts +1 -0
  8. package/components/Button/button.module.scss +6 -1
  9. package/components/Button/button.ts +2 -2
  10. package/components/Carousel/Carousel.astro +198 -0
  11. package/components/Carousel/Carousel.svelte +161 -0
  12. package/components/Carousel/Carousel.tsx +172 -0
  13. package/components/Carousel/carousel.module.scss +58 -0
  14. package/components/Carousel/carousel.ts +26 -0
  15. package/components/DataTable/DataTable.astro +332 -0
  16. package/components/DataTable/DataTable.svelte +272 -0
  17. package/components/DataTable/DataTable.tsx +287 -0
  18. package/components/DataTable/datatable.module.scss +102 -0
  19. package/components/DataTable/datatable.ts +41 -0
  20. package/components/Icon/map.ts +6 -0
  21. package/components/Input/input.module.scss +6 -0
  22. package/components/List/List.astro +1 -1
  23. package/components/List/List.svelte +1 -1
  24. package/components/List/List.tsx +1 -2
  25. package/components/Pagination/Pagination.astro +189 -0
  26. package/components/Pagination/Pagination.svelte +144 -0
  27. package/components/Pagination/Pagination.tsx +162 -0
  28. package/components/Pagination/pagination.module.scss +49 -0
  29. package/components/Pagination/pagination.ts +35 -0
  30. package/components/Select/Select.astro +8 -4
  31. package/components/Select/Select.svelte +15 -6
  32. package/components/Select/Select.tsx +15 -8
  33. package/components/Select/select.ts +7 -2
  34. package/components/Table/Table.svelte +1 -1
  35. package/components/Table/table.ts +1 -1
  36. package/icons/arrow-left.svg +3 -0
  37. package/icons/arrow-right.svg +3 -0
  38. package/icons/order.svg +3 -0
  39. package/icons.d.ts +3 -0
  40. package/icons.js +3 -0
  41. package/index.d.ts +6 -6
  42. package/package.json +1 -1
  43. package/react.d.ts +6 -0
  44. package/react.js +6 -0
  45. package/scss/resets.scss +27 -1
  46. package/svelte.d.ts +6 -0
  47. package/svelte.js +6 -0
package/README.md CHANGED
@@ -1,227 +1,230 @@
1
- <p>
2
- <a href="https://webcoreui.dev">
3
- <img
4
- alt="Webcore - Frontend components for Astro, Svelte, and React"
5
- src="https://raw.githubusercontent.com/Frontendland/webcoreui/main/public/img/banner.png"
6
- />
7
- </a>
8
- </p>
9
-
10
- <p align="center">
11
- <a href="https://github.com/Frontendland/webcoreui/releases">
12
- <img
13
- src="https://img.shields.io/npm/v/webcoreui.svg?label=Latest%20Release"
14
- alt="Latest Release"
15
- />
16
- </a>
17
- <a href="https://github.com/Frontendland/webcoreui/blob/main/LICENSE">
18
- <img
19
- src="https://img.shields.io/badge/license-MIT-blue"
20
- alt="License"
21
- />
22
- </a>
23
- </p>
24
-
25
- > [!IMPORTANT]
26
- > This library is still in early development. New changes can break existing functionality, and no functionality should be considered final at this stage. The library will be considered stable once it reaches v1.0.
27
-
28
- ---
29
- ## Table of Contents
30
-
31
- - [Table of Contents](#table-of-contents)
32
- - [Documentation](#documentation)
33
- - [Getting started](#getting-started)
34
- - [Prerequisites](#prerequisites)
35
- - [Installation](#installation)
36
- - [Setup](#setup)
37
- - [Using Components](#using-components)
38
- - [Components](#components)
39
-
40
- ## Documentation
41
-
42
- Full documentation available on [webcoreui.dev](https://webcoreui.dev).
43
-
44
- ## Getting Started
45
-
46
- Webcore can be used as a standalone project, or it can be integrated into your existing Astro, Svelte, or React ecosystems. The easiest way to get started is to clone the repository and run `npm run dev` to start building your pages with the components available.
47
-
48
- ### Prerequisites
49
-
50
- > [!NOTE]
51
- > Before getting started, make sure you have a package manager installed, such as <a href="https://nodejs.org/en/" rel="noreferrer">Node</a>.
52
-
53
- Webcore components use Sass for styling. To use the component library, you must have the following packages installed:
54
-
55
- - [Sass](https://www.npmjs.com/package/sass) - `v1.77` and above
56
- - [TypeScript](https://www.npmjs.com/package/typescript) - `v5.4` and above
57
-
58
- Depending on your project setup, you'll also need the following packages:
59
-
60
- - **For Astro projects**
61
- - [Astro](https://www.npmjs.com/package/astro) - `v4.10` and above
62
- - **For Svelte projects**
63
- - [Svelte](https://www.npmjs.com/package/svelte) - `v4.2` and above
64
- - **For React projects**
65
- - [React](https://www.npmjs.com/package/react) - `v18.3` and above
66
- - [React DOM](https://www.npmjs.com/package/react-dom) -`v18.3` and above
67
-
68
- ### Installation
69
-
70
- Install Webcore as a dependency by running one of the following command:
71
-
72
- ```bash
73
- # Using NPM
74
- npm i webcoreui
75
-
76
- # Using Yarn
77
- yarn add webcoreui
78
- ```
79
-
80
- ### Setup
81
-
82
- Create an empty [`webcore.config.scss`](https://webcoreui.dev/docs/css-configuration#webcoreconfigscss) file at the root of your project to setup CSS configurations. Setup default styles and fonts by calling the following in your global SCSS file:
83
-
84
- ```scss
85
- @import 'webcoreui/styles';
86
- @include setup((
87
- // Define paths for your fonts
88
- fontRegular: '/fonts/Inter-Regular.woff2',
89
- fontBold: '/fonts/Inter-Bold.woff2'
90
- ));
91
- ```
92
-
93
- > [!TIP]
94
- > You can download the fonts Webcore uses from the [`public/fonts`](https://github.com/Frontendland/webcoreui/tree/main/public/fonts) directory.
95
-
96
- The `Setup` mixin can also accept the following options:
97
-
98
-
99
- | Property | Default value | Purpose |
100
- |-----------|---------------|---------|
101
- | `includeResets` | `true` | Include reset styles. Set to `false` if you want to use your own CSS resets. |
102
- | `includeUtilities` | `true` | Adds utility classes for CSS. Read more about the available utility classes [here](https://webcoreui.dev/docs/layout). |
103
- | `includeTooltip` | `true` | Adds styles for using tooltips.
104
- | `includeScrollbarStyles` | `true` | Adds styles for scrollbars.
105
-
106
- Default component styles can be changed by overriding the following CSS variables:
107
-
108
- ```scss
109
- html body {
110
- // Avatar component
111
- --w-avatar-border: var(--w-color-primary-70);
112
-
113
- // Checkbox component
114
- --w-checkbox-color: var(--w-color-primary);
115
-
116
- // Collapsible component
117
- --w-collapsible-initial-height: 0;
118
- --w-collapsible-max-height: 100%;
119
-
120
- // Progress component
121
- --w-progress-color: var(--w-color-primary);
122
- --w-progress-background: var(--w-color-primary-50);
123
- --w-progress-stripe-light: var(--w-color-primary);
124
- --w-progress-stripe-dark: var(--w-color-primary-10);
125
-
126
- // Radio component
127
- --w-radio-color: var(--w-color-primary);
128
-
129
- // Rating component
130
- --w-rating-color: var(--w-color-primary);
131
- --w-rating-empty-color: var(--w-color-primary);
132
- --w-rating-empty-background: var(--w-color-primary-70);
133
- --w-rating-size: 18px;
134
-
135
- // Scrollbars
136
- --w-scrollbar-bg: var(--w-color-primary-60);
137
- --w-scrollbar-fg: var(--w-color-primary-50);
138
-
139
- // Slider component
140
- --w-slider-background: var(--w-color-primary-50);
141
- --w-slider-color: var(--w-color-primary);
142
- --w-slider-thumb: var(--w-color-primary-50);
143
-
144
- // Spinner component
145
- --w-spinner-color: var(--w-color-primary);
146
- --w-spinner-width: 2px;
147
- --w-spinner-speed: 2s;
148
- --w-spinner-size: 30px;
149
- --w-spinner-dash: 8;
150
-
151
- // Switch component
152
- --w-switch-off-color: var(--w-color-primary-50);
153
- --w-switch-on-color: var(--w-color-primary);
154
-
155
- // ThemeSwitcher component
156
- --w-theme-switcher-size: 20px;
157
-
158
- // Timeline component
159
- --w-timeline-color: var(--w-color-primary-50);
160
- --w-timeline-text-color: var(--w-color-primary);
161
- --w-timeline-counter: decimal;
162
-
163
- // Tooltips
164
- --w-tooltip-background: var(--w-color-primary);
165
- --w-tooltip-color: var(--w-color-primary-70);
166
-
167
- // Override border-radius
168
- --w-sm-radius: 2px;
169
- --w-md-radius: 5px;
170
- --w-lg-radius: 10px;
171
- --w-xl-radius: 15px;
172
- }
173
- ```
174
-
175
- ### Using Components
176
-
177
- Start using Webcore components in your code by importing them:
178
-
179
- ```astro
180
- ---
181
- // Import the component relevant to your project
182
- // How to import Astro components
183
- import { Accordion } from 'webcoreui/astro'
184
-
185
- // How to import Svelte components
186
- import { Accordion } from 'webcoreui/svelte'
187
-
188
- // How to import React components
189
- import { Accordion } from 'webcoreui/react'
190
- ---
191
-
192
- <Accordion items={[{ ... }]} />
193
- ```
194
-
195
- ## Components
196
-
197
- - [Accordion](https://github.com/Frontendland/webcoreui/tree/main/src/components/Accordion)
198
- - [Alert](https://github.com/Frontendland/webcoreui/tree/main/src/components/Alert)
199
- - [Avatar](https://github.com/Frontendland/webcoreui/tree/main/src/components/Avatar)
200
- - [Badge](https://github.com/Frontendland/webcoreui/tree/main/src/components/Badge)
201
- - [Button](https://github.com/Frontendland/webcoreui/tree/main/src/components/Button)
202
- - [Card](https://github.com/Frontendland/webcoreui/tree/main/src/components/Card)
203
- - [Checkbox](https://github.com/Frontendland/webcoreui/tree/main/src/components/Checkbox)
204
- - [Collapsible](https://github.com/Frontendland/webcoreui/tree/main/src/components/Collapsible)
205
- - [ConditionalWrapper](https://github.com/Frontendland/webcoreui/tree/main/src/components/ConditionalWrapper)
206
- - [Group](https://github.com/Frontendland/webcoreui/tree/main/src/components/Group)
207
- - [Icon](https://github.com/Frontendland/webcoreui/tree/main/src/components/Icon)
208
- - [Input](https://github.com/Frontendland/webcoreui/tree/main/src/components/Input)
209
- - [List](https://github.com/Frontendland/webcoreui/tree/main/src/components/List)
210
- - [Menu](https://github.com/Frontendland/webcoreui/tree/main/src/components/Menu)
211
- - [Modal](https://github.com/Frontendland/webcoreui/tree/main/src/components/Modal)
212
- - [Popover](https://github.com/Frontendland/webcoreui/tree/main/src/components/Popover)
213
- - [Progress](https://github.com/Frontendland/webcoreui/tree/main/src/components/Progress)
214
- - [Radio](https://github.com/Frontendland/webcoreui/tree/main/src/components/Radio)
215
- - [Rating](https://github.com/Frontendland/webcoreui/tree/main/src/components/Rating)
216
- - [Select](https://github.com/Frontendland/webcoreui/tree/main/src/components/Select)
217
- - [Sheet](https://github.com/Frontendland/webcoreui/tree/main/src/components/Sheet)
218
- - [Slider](https://github.com/Frontendland/webcoreui/tree/main/src/components/Slider)
219
- - [Spinner](https://github.com/Frontendland/webcoreui/tree/main/src/components/Spinner)
220
- - [Switch](https://github.com/Frontendland/webcoreui/tree/main/src/components/Switch)
221
- - [Table](https://github.com/Frontendland/webcoreui/tree/main/src/components/Table)
222
- - [Tabs](https://github.com/Frontendland/webcoreui/tree/main/src/components/Tabs)
223
- - [Textarea](https://github.com/Frontendland/webcoreui/tree/main/src/components/Textarea)
224
- - [ThemeSwitcher](https://github.com/Frontendland/webcoreui/tree/main/src/components/ThemeSwitcher)
225
- - [Timeline](https://github.com/Frontendland/webcoreui/blob/main/src/pages/timeline.astro)
226
- - [Toast](https://github.com/Frontendland/webcoreui/tree/main/src/components/Toast)
227
- - [Tooltip](https://github.com/Frontendland/webcoreui/blob/main/src/pages/tooltip.astro)
1
+ <p>
2
+ <a href="https://webcoreui.dev">
3
+ <img
4
+ alt="Webcore - Frontend components for Astro, Svelte, and React"
5
+ src="https://raw.githubusercontent.com/Frontendland/webcoreui/main/public/img/banner.png"
6
+ />
7
+ </a>
8
+ </p>
9
+
10
+ <p align="center">
11
+ <a href="https://github.com/Frontendland/webcoreui/releases">
12
+ <img
13
+ src="https://img.shields.io/npm/v/webcoreui.svg?label=Latest%20Release"
14
+ alt="Latest Release"
15
+ />
16
+ </a>
17
+ <a href="https://github.com/Frontendland/webcoreui/blob/main/LICENSE">
18
+ <img
19
+ src="https://img.shields.io/badge/license-MIT-blue"
20
+ alt="License"
21
+ />
22
+ </a>
23
+ </p>
24
+
25
+ > [!IMPORTANT]
26
+ > This library is still in early development. New changes can break existing functionality, and no functionality should be considered final at this stage. The library will be considered stable once it reaches v1.0.
27
+
28
+ ---
29
+ ## Table of Contents
30
+
31
+ - [Table of Contents](#table-of-contents)
32
+ - [Documentation](#documentation)
33
+ - [Getting started](#getting-started)
34
+ - [Prerequisites](#prerequisites)
35
+ - [Installation](#installation)
36
+ - [Setup](#setup)
37
+ - [Using Components](#using-components)
38
+ - [Components](#components)
39
+
40
+ ## Documentation
41
+
42
+ Full documentation available on [webcoreui.dev](https://webcoreui.dev).
43
+
44
+ ## Getting Started
45
+
46
+ Webcore can be used as a standalone project, or it can be integrated into your existing Astro, Svelte, or React ecosystems. The easiest way to get started is to clone the repository and run `npm run dev` to start building your pages with the components available.
47
+
48
+ ### Prerequisites
49
+
50
+ > [!NOTE]
51
+ > Before getting started, make sure you have a package manager installed, such as <a href="https://nodejs.org/en/" rel="noreferrer">Node</a>.
52
+
53
+ Webcore components use Sass for styling. To use the component library, you must have the following packages installed:
54
+
55
+ - [Sass](https://www.npmjs.com/package/sass) - `v1.77` and above
56
+ - [TypeScript](https://www.npmjs.com/package/typescript) - `v5.4` and above
57
+
58
+ Depending on your project setup, you'll also need the following packages:
59
+
60
+ - **For Astro projects**
61
+ - [Astro](https://www.npmjs.com/package/astro) - `v4.10` and above
62
+ - **For Svelte projects**
63
+ - [Svelte](https://www.npmjs.com/package/svelte) - `v4.2` and above
64
+ - **For React projects**
65
+ - [React](https://www.npmjs.com/package/react) - `v18.3` and above
66
+ - [React DOM](https://www.npmjs.com/package/react-dom) -`v18.3` and above
67
+
68
+ ### Installation
69
+
70
+ Install Webcore as a dependency by running one of the following command:
71
+
72
+ ```bash
73
+ # Using NPM
74
+ npm i webcoreui
75
+
76
+ # Using Yarn
77
+ yarn add webcoreui
78
+ ```
79
+
80
+ ### Setup
81
+
82
+ Create an empty [`webcore.config.scss`](https://webcoreui.dev/docs/css-configuration#webcoreconfigscss) file at the root of your project to setup CSS configurations. Setup default styles and fonts by calling the following in your global SCSS file:
83
+
84
+ ```scss
85
+ @import 'webcoreui/styles';
86
+ @include setup((
87
+ // Define paths for your fonts
88
+ fontRegular: '/fonts/Inter-Regular.woff2',
89
+ fontBold: '/fonts/Inter-Bold.woff2'
90
+ ));
91
+ ```
92
+
93
+ > [!TIP]
94
+ > You can download the fonts Webcore uses from the [`public/fonts`](https://github.com/Frontendland/webcoreui/tree/main/public/fonts) directory.
95
+
96
+ The `Setup` mixin can also accept the following options:
97
+
98
+
99
+ | Property | Default value | Purpose |
100
+ |-----------|---------------|---------|
101
+ | `includeResets` | `true` | Include reset styles. Set to `false` if you want to use your own CSS resets. |
102
+ | `includeUtilities` | `true` | Adds utility classes for CSS. Read more about the available utility classes [here](https://webcoreui.dev/docs/layout). |
103
+ | `includeTooltip` | `true` | Adds styles for using tooltips.
104
+ | `includeScrollbarStyles` | `true` | Adds styles for scrollbars.
105
+
106
+ Default component styles can be changed by overriding the following CSS variables:
107
+
108
+ ```scss
109
+ html body {
110
+ // Avatar component
111
+ --w-avatar-border: var(--w-color-primary-70);
112
+
113
+ // Checkbox component
114
+ --w-checkbox-color: var(--w-color-primary);
115
+
116
+ // Collapsible component
117
+ --w-collapsible-initial-height: 0;
118
+ --w-collapsible-max-height: 100%;
119
+
120
+ // Progress component
121
+ --w-progress-color: var(--w-color-primary);
122
+ --w-progress-background: var(--w-color-primary-50);
123
+ --w-progress-stripe-light: var(--w-color-primary);
124
+ --w-progress-stripe-dark: var(--w-color-primary-10);
125
+
126
+ // Radio component
127
+ --w-radio-color: var(--w-color-primary);
128
+
129
+ // Rating component
130
+ --w-rating-color: var(--w-color-primary);
131
+ --w-rating-empty-color: var(--w-color-primary);
132
+ --w-rating-empty-background: var(--w-color-primary-70);
133
+ --w-rating-size: 18px;
134
+
135
+ // Scrollbars
136
+ --w-scrollbar-bg: var(--w-color-primary-60);
137
+ --w-scrollbar-fg: var(--w-color-primary-50);
138
+
139
+ // Slider component
140
+ --w-slider-background: var(--w-color-primary-50);
141
+ --w-slider-color: var(--w-color-primary);
142
+ --w-slider-thumb: var(--w-color-primary-50);
143
+
144
+ // Spinner component
145
+ --w-spinner-color: var(--w-color-primary);
146
+ --w-spinner-width: 2px;
147
+ --w-spinner-speed: 2s;
148
+ --w-spinner-size: 30px;
149
+ --w-spinner-dash: 8;
150
+
151
+ // Switch component
152
+ --w-switch-off-color: var(--w-color-primary-50);
153
+ --w-switch-on-color: var(--w-color-primary);
154
+
155
+ // ThemeSwitcher component
156
+ --w-theme-switcher-size: 20px;
157
+
158
+ // Timeline component
159
+ --w-timeline-color: var(--w-color-primary-50);
160
+ --w-timeline-text-color: var(--w-color-primary);
161
+ --w-timeline-counter: decimal;
162
+
163
+ // Tooltips
164
+ --w-tooltip-background: var(--w-color-primary);
165
+ --w-tooltip-color: var(--w-color-primary-70);
166
+
167
+ // Override border-radius
168
+ --w-sm-radius: 2px;
169
+ --w-md-radius: 5px;
170
+ --w-lg-radius: 10px;
171
+ --w-xl-radius: 15px;
172
+ }
173
+ ```
174
+
175
+ ### Using Components
176
+
177
+ Start using Webcore components in your code by importing them:
178
+
179
+ ```astro
180
+ ---
181
+ // Import the component relevant to your project
182
+ // How to import Astro components
183
+ import { Accordion } from 'webcoreui/astro'
184
+
185
+ // How to import Svelte components
186
+ import { Accordion } from 'webcoreui/svelte'
187
+
188
+ // How to import React components
189
+ import { Accordion } from 'webcoreui/react'
190
+ ---
191
+
192
+ <Accordion items={[{ ... }]} />
193
+ ```
194
+
195
+ ## Components
196
+
197
+ - [Accordion](https://github.com/Frontendland/webcoreui/tree/main/src/components/Accordion)
198
+ - [Alert](https://github.com/Frontendland/webcoreui/tree/main/src/components/Alert)
199
+ - [Avatar](https://github.com/Frontendland/webcoreui/tree/main/src/components/Avatar)
200
+ - [Badge](https://github.com/Frontendland/webcoreui/tree/main/src/components/Badge)
201
+ - [Button](https://github.com/Frontendland/webcoreui/tree/main/src/components/Button)
202
+ - [Card](https://github.com/Frontendland/webcoreui/tree/main/src/components/Card)
203
+ - [Carousel](https://github.com/Frontendland/webcoreui/tree/main/src/components/Carousel)
204
+ - [Checkbox](https://github.com/Frontendland/webcoreui/tree/main/src/components/Checkbox)
205
+ - [Collapsible](https://github.com/Frontendland/webcoreui/tree/main/src/components/Collapsible)
206
+ - [ConditionalWrapper](https://github.com/Frontendland/webcoreui/tree/main/src/components/ConditionalWrapper)
207
+ - [DataTable](https://github.com/Frontendland/webcoreui/tree/main/src/components/DataTable)
208
+ - [Group](https://github.com/Frontendland/webcoreui/tree/main/src/components/Group)
209
+ - [Icon](https://github.com/Frontendland/webcoreui/tree/main/src/components/Icon)
210
+ - [Input](https://github.com/Frontendland/webcoreui/tree/main/src/components/Input)
211
+ - [List](https://github.com/Frontendland/webcoreui/tree/main/src/components/List)
212
+ - [Menu](https://github.com/Frontendland/webcoreui/tree/main/src/components/Menu)
213
+ - [Modal](https://github.com/Frontendland/webcoreui/tree/main/src/components/Modal)
214
+ - [Pagination](https://github.com/Frontendland/webcoreui/tree/main/src/components/Pagination)
215
+ - [Popover](https://github.com/Frontendland/webcoreui/tree/main/src/components/Popover)
216
+ - [Progress](https://github.com/Frontendland/webcoreui/tree/main/src/components/Progress)
217
+ - [Radio](https://github.com/Frontendland/webcoreui/tree/main/src/components/Radio)
218
+ - [Rating](https://github.com/Frontendland/webcoreui/tree/main/src/components/Rating)
219
+ - [Select](https://github.com/Frontendland/webcoreui/tree/main/src/components/Select)
220
+ - [Sheet](https://github.com/Frontendland/webcoreui/tree/main/src/components/Sheet)
221
+ - [Slider](https://github.com/Frontendland/webcoreui/tree/main/src/components/Slider)
222
+ - [Spinner](https://github.com/Frontendland/webcoreui/tree/main/src/components/Spinner)
223
+ - [Switch](https://github.com/Frontendland/webcoreui/tree/main/src/components/Switch)
224
+ - [Table](https://github.com/Frontendland/webcoreui/tree/main/src/components/Table)
225
+ - [Tabs](https://github.com/Frontendland/webcoreui/tree/main/src/components/Tabs)
226
+ - [Textarea](https://github.com/Frontendland/webcoreui/tree/main/src/components/Textarea)
227
+ - [ThemeSwitcher](https://github.com/Frontendland/webcoreui/tree/main/src/components/ThemeSwitcher)
228
+ - [Timeline](https://github.com/Frontendland/webcoreui/blob/main/src/pages/timeline.astro)
229
+ - [Toast](https://github.com/Frontendland/webcoreui/tree/main/src/components/Toast)
230
+ - [Tooltip](https://github.com/Frontendland/webcoreui/blob/main/src/pages/tooltip.astro)
package/astro.d.ts CHANGED
@@ -4,15 +4,18 @@ import type { AvatarProps } from './components/Avatar/avatar'
4
4
  import type { BadgeProps } from './components/Badge/badge'
5
5
  import type { ButtonProps } from './components/Button/button'
6
6
  import type { CardProps } from './components/Card/card'
7
+ import type { CarouselProps } from './components/Carousel/carousel'
7
8
  import type { CheckboxProps } from './components/Checkbox/checkbox'
8
9
  import type { CollapsibleProps } from './components/Collapsible/collapsible'
9
10
  import type { ConditionalWrapperProps } from './components/ConditionalWrapper/conditionalwrapper'
11
+ import type { DataTableProps } from './components/DataTable/datatable'
10
12
  import type { GroupProps } from './components/Group/group'
11
13
  import type { IconProps } from './components/Icon/icon'
12
14
  import type { InputProps } from './components/Input/input'
13
15
  import type { ListProps } from './components/List/list'
14
16
  import type { MenuProps } from './components/Menu/menu'
15
17
  import type { ModalProps } from './components/Modal/modal'
18
+ import type { PaginationProps } from './components/Pagination/pagination'
16
19
  import type { PopoverProps } from './components/Popover/popover'
17
20
  import type { ProgressProps } from './components/Progress/progress'
18
21
  import type { RadioProps } from './components/Radio/radio'
@@ -37,15 +40,18 @@ declare module 'webcoreui/astro' {
37
40
  export function Badge(_props: BadgeProps): any
38
41
  export function Button(_props: ButtonProps): any
39
42
  export function Card(_props: CardProps): any
43
+ export function Carousel(_props: CarouselProps): any
40
44
  export function Checkbox(_props: CheckboxProps): any
41
45
  export function Collapsible(_props: CollapsibleProps): any
42
46
  export function ConditionalWrapper(_props: ConditionalWrapperProps): any
47
+ export function DataTable(_props: DataTableProps): any
43
48
  export function Group(_props: GroupProps): any
44
49
  export function Icon(_props: IconProps): any
45
50
  export function Input(_props: InputProps): any
46
51
  export function List(_props: ListProps): any
47
52
  export function Menu(_props: MenuProps): any
48
53
  export function Modal(_props: ModalProps): any
54
+ export function Pagination(_props: PaginationProps): any
49
55
  export function Popover(_props: PopoverProps): any
50
56
  export function Progress(_props: ProgressProps): any
51
57
  export function Radio(_props: RadioProps): any
package/astro.js CHANGED
@@ -4,15 +4,18 @@ import AvatarComponent from './components/Avatar/Avatar.astro'
4
4
  import BadgeComponent from './components/Badge/Badge.astro'
5
5
  import ButtonComponent from './components/Button/Button.astro'
6
6
  import CardComponent from './components/Card/Card.astro'
7
+ import CarouselComponent from './components/Carousel/Carousel.astro'
7
8
  import CheckboxComponent from './components/Checkbox/Checkbox.astro'
8
9
  import CollapsibleComponent from './components/Collapsible/Collapsible.astro'
9
10
  import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.astro'
11
+ import DataTableComponent from './components/DataTable/DataTable.astro'
10
12
  import GroupComponent from './components/Group/Group.astro'
11
13
  import IconComponent from './components/Icon/Icon.astro'
12
14
  import InputComponent from './components/Input/Input.astro'
13
15
  import ListComponent from './components/List/List.astro'
14
16
  import MenuComponent from './components/Menu/Menu.astro'
15
17
  import ModalComponent from './components/Modal/Modal.astro'
18
+ import PaginationComponent from './components/Pagination/Pagination.astro'
16
19
  import PopoverComponent from './components/Popover/Popover.astro'
17
20
  import ProgressComponent from './components/Progress/Progress.astro'
18
21
  import RadioComponent from './components/Radio/Radio.astro'
@@ -36,15 +39,18 @@ export const Avatar = AvatarComponent
36
39
  export const Badge = BadgeComponent
37
40
  export const Button = ButtonComponent
38
41
  export const Card = CardComponent
42
+ export const Carousel = CarouselComponent
39
43
  export const Checkbox = CheckboxComponent
40
44
  export const Collapsible = CollapsibleComponent
41
45
  export const ConditionalWrapper = ConditionalWrapperComponent
46
+ export const DataTable = DataTableComponent
42
47
  export const Group = GroupComponent
43
48
  export const Icon = IconComponent
44
49
  export const Input = InputComponent
45
50
  export const List = ListComponent
46
51
  export const Menu = MenuComponent
47
52
  export const Modal = ModalComponent
53
+ export const Pagination = PaginationComponent
48
54
  export const Popover = PopoverComponent
49
55
  export const Progress = ProgressComponent
50
56
  export const Radio = RadioComponent
@@ -13,7 +13,8 @@ const {
13
13
  borderColor,
14
14
  borderless,
15
15
  reverse,
16
- className
16
+ className,
17
+ groupClassName
17
18
  } = Astro.props
18
19
 
19
20
  const classes = [
@@ -21,10 +22,16 @@ const classes = [
21
22
  borderless && styles.borderless,
22
23
  className
23
24
  ]
25
+
26
+ const groupClasses = [
27
+ styles.group,
28
+ reverse && styles.reverse,
29
+ groupClassName
30
+ ]
24
31
  ---
25
32
 
26
33
  {Array.isArray(img) ? (
27
- <div class:list={[styles.group, reverse && styles.reverse]}
34
+ <div class:list={groupClasses}
28
35
  style={borderColor ? `--w-avatar-border: ${borderColor};` : null}
29
36
  >
30
37
  {img.map((img, index) => (
@@ -13,6 +13,7 @@
13
13
  export let borderless: AvatarProps['borderless'] = false
14
14
  export let reverse: AvatarProps['reverse'] = false
15
15
  export let className: AvatarProps['className'] = ''
16
+ export let groupClassName: AvatarProps['groupClassName'] = ''
16
17
 
17
18
  const classes = classNames([
18
19
  styles.avatar,
@@ -22,7 +23,8 @@
22
23
 
23
24
  const groupStyles = classNames([
24
25
  styles.group,
25
- reverse && styles.reverse
26
+ reverse && styles.reverse,
27
+ groupClassName
26
28
  ])
27
29
  </script>
28
30
 
@@ -13,7 +13,8 @@ const Avatar = ({
13
13
  borderColor,
14
14
  borderless,
15
15
  reverse,
16
- className
16
+ className,
17
+ groupClassName
17
18
  }: AvatarProps) => {
18
19
  const classes = classNames([
19
20
  styles.avatar,
@@ -23,7 +24,8 @@ const Avatar = ({
23
24
 
24
25
  const groupStyles = classNames([
25
26
  styles.group,
26
- reverse && styles.reverse
27
+ reverse && styles.reverse,
28
+ groupClassName
27
29
  ])
28
30
 
29
31
  const borderColorStyle = borderColor
@@ -7,4 +7,5 @@ export type AvatarProps = {
7
7
  borderless?: boolean
8
8
  reverse?: boolean
9
9
  className?: string
10
+ groupClassName?: string
10
11
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  .button {
4
4
  @include layout(inline-flex, center, xs);
5
- @include typography(default, primary-50, none);
5
+ @include typography(default, primary-50, none, normal);
6
6
  @include spacing(py-sm, px-md);
7
7
  @include border-radius(xs);
8
8
  @include border(0);
@@ -38,6 +38,11 @@
38
38
  @include typography(primary);
39
39
  box-shadow: inset 0px 0px 0px 1px var(--w-color-primary);
40
40
  }
41
+
42
+ &[disabled] {
43
+ @include typography(primary-30);
44
+ box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-30);
45
+ }
41
46
  }
42
47
 
43
48
  &.flat {
@@ -13,10 +13,10 @@ export type ButtonProps = {
13
13
  }
14
14
 
15
15
  export type SvelteButtonProps = {
16
- onClick?: () => any
16
+ onClick?: (() => any) | null
17
17
  } & ButtonProps
18
18
 
19
19
  export type ReactButtonProps = {
20
- onClick?: () => any
20
+ onClick?: (() => any) | null
21
21
  children: React.ReactNode
22
22
  } & ButtonProps