@krumio/trailhand-ui 1.4.1 → 1.6.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 +205 -47
- package/dist/components/action-menu/action-menu.d.ts.map +1 -0
- package/dist/{action-menu.js → components/action-menu/action-menu.js} +51 -39
- package/dist/components/action-menu/action-menu.js.map +1 -0
- package/dist/components/action-menu/index.d.ts +2 -0
- package/dist/components/action-menu/index.d.ts.map +1 -0
- package/dist/components/action-menu/index.js +2 -0
- package/dist/components/action-menu/index.js.map +1 -0
- package/dist/components/button/button.d.ts +20 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.js +189 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/{data-table.d.ts → components/data-table/data-table.d.ts} +1 -1
- package/dist/components/data-table/data-table.d.ts.map +1 -0
- package/dist/{data-table.js → components/data-table/data-table.js} +207 -146
- package/dist/components/data-table/data-table.js.map +1 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.d.ts.map +1 -0
- package/dist/components/data-table/index.js +2 -0
- package/dist/components/data-table/index.js.map +1 -0
- package/dist/components/icon/icon.d.ts +18 -0
- package/dist/components/icon/icon.d.ts.map +1 -0
- package/dist/components/icon/icon.js +44 -0
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/index.d.ts.map +1 -0
- package/dist/components/icon/index.js +2 -0
- package/dist/components/icon/index.js.map +1 -0
- package/dist/components/toggle-switch/index.d.ts +2 -0
- package/dist/components/toggle-switch/index.d.ts.map +1 -0
- package/dist/components/toggle-switch/index.js +2 -0
- package/dist/components/toggle-switch/index.js.map +1 -0
- package/dist/components/toggle-switch/toggle-switch.d.ts.map +1 -0
- package/dist/{toggle-switch.js → components/toggle-switch/toggle-switch.js} +9 -9
- package/dist/components/toggle-switch/toggle-switch.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/colors.css +132 -0
- package/package.json +23 -11
- package/dist/Button.d.ts +0 -15
- package/dist/Button.d.ts.map +0 -1
- package/dist/Button.js +0 -18
- package/dist/Button.js.map +0 -1
- package/dist/Header.d.ts +0 -15
- package/dist/Header.d.ts.map +0 -1
- package/dist/Header.js +0 -44
- package/dist/Header.js.map +0 -1
- package/dist/Page.d.ts +0 -9
- package/dist/Page.d.ts.map +0 -1
- package/dist/Page.js +0 -61
- package/dist/Page.js.map +0 -1
- package/dist/action-menu.d.ts.map +0 -1
- package/dist/action-menu.js.map +0 -1
- package/dist/assets/index-B7q5L5KS.js +0 -91
- package/dist/data-table.d.ts.map +0 -1
- package/dist/data-table.js.map +0 -1
- package/dist/index.html +0 -102
- package/dist/toggle-switch.d.ts.map +0 -1
- package/dist/toggle-switch.js.map +0 -1
- /package/dist/{action-menu.d.ts → components/action-menu/action-menu.d.ts} +0 -0
- /package/dist/{toggle-switch.d.ts → components/toggle-switch/toggle-switch.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,21 +1,74 @@
|
|
|
1
1
|
# Trailhand UI
|
|
2
2
|
|
|
3
|
-
A component library built with Lit Element web components and Storybook.
|
|
3
|
+
A component library built with Lit Element web components, TypeScript, and Storybook.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm install @krumio/trailhand-ui
|
|
9
|
+
```
|
|
8
10
|
|
|
9
|
-
##
|
|
11
|
+
## Usage
|
|
10
12
|
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
+
```javascript
|
|
14
|
+
// Import components
|
|
15
|
+
import '@krumio/trailhand-ui/toggle-switch';
|
|
16
|
+
import '@krumio/trailhand-ui/data-table';
|
|
17
|
+
import '@krumio/trailhand-ui/action-menu';
|
|
18
|
+
|
|
19
|
+
// Import global color variables (optional)
|
|
20
|
+
import '@krumio/trailhand-ui/styles/colors.css';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<!-- Use in HTML -->
|
|
25
|
+
<toggle-switch onLabel="On" offLabel="Off"></toggle-switch>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Global Color Variables
|
|
29
|
+
|
|
30
|
+
Trailhand UI includes a design system with CSS custom properties. Import `colors.css` to use consistent colors across your app:
|
|
31
|
+
|
|
32
|
+
```css
|
|
33
|
+
/* Available variables */
|
|
34
|
+
--color-primary: #3d98d3;
|
|
35
|
+
--color-white: #FFFFFF;
|
|
36
|
+
--color-black: #000000;
|
|
37
|
+
|
|
38
|
+
/* Greyscale */
|
|
39
|
+
--color-grey-100 through --color-grey-800
|
|
40
|
+
|
|
41
|
+
/* Semantic aliases */
|
|
42
|
+
--color-text-primary: #212121;
|
|
43
|
+
--color-text-secondary: #636363;
|
|
44
|
+
--color-text-muted: #8D8D8D;
|
|
45
|
+
--color-background: #FFFFFF;
|
|
46
|
+
--color-border: #D7D7D7;
|
|
47
|
+
--color-error: #9F3A3A;
|
|
48
|
+
--color-success: #30AC66;
|
|
49
|
+
--color-warning: #D3C255;
|
|
13
50
|
```
|
|
14
51
|
|
|
15
|
-
###
|
|
52
|
+
### Theming
|
|
53
|
+
|
|
54
|
+
Override any variable to customize the look:
|
|
55
|
+
|
|
56
|
+
```css
|
|
57
|
+
:root {
|
|
58
|
+
--color-primary: #your-brand-color;
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
### Recommended IDE Setup
|
|
65
|
+
|
|
66
|
+
VSCode with ES6, Lit, and TypeScript plugin support.
|
|
67
|
+
|
|
68
|
+
### Project Setup
|
|
16
69
|
|
|
17
70
|
```bash
|
|
18
|
-
npm
|
|
71
|
+
npm install
|
|
19
72
|
```
|
|
20
73
|
|
|
21
74
|
### Storybook Development
|
|
@@ -40,65 +93,170 @@ npm run build-storybook
|
|
|
40
93
|
|
|
41
94
|
```
|
|
42
95
|
trailhand-ui/
|
|
43
|
-
├──
|
|
44
|
-
├──
|
|
45
|
-
├──
|
|
46
|
-
│ ├──
|
|
47
|
-
│
|
|
48
|
-
├──
|
|
96
|
+
├── src/
|
|
97
|
+
│ ├── components/ # Components
|
|
98
|
+
│ │ ├── button/ # Component folder
|
|
99
|
+
│ │ │ ├── button.ts # Web component
|
|
100
|
+
│ │ │ ├── index.ts # Export file
|
|
101
|
+
│ │ │ ├── button.stories.ts # Storybook for documentation and testing
|
|
102
|
+
│ │ │ └── button.test.ts # Unit tests
|
|
103
|
+
│ │ └── more components/
|
|
104
|
+
│ ├── design-system/ # Design system stories
|
|
105
|
+
│ └── styles/
|
|
106
|
+
│ └── colors.css # Global color variables
|
|
107
|
+
├── dev/ # Playground application for development
|
|
108
|
+
├── stories/ # Additional Storybook stories
|
|
109
|
+
├── .storybook/ # Storybook configuration
|
|
110
|
+
├── dist/ # Compiled output
|
|
49
111
|
└── package.json
|
|
50
112
|
```
|
|
51
113
|
|
|
52
|
-
##
|
|
114
|
+
## Components
|
|
53
115
|
|
|
54
|
-
|
|
116
|
+
### ToggleSwitch
|
|
55
117
|
|
|
56
|
-
|
|
57
|
-
- Framework agnostic
|
|
58
|
-
- Encapsulated styles and functionality
|
|
59
|
-
- Reusable across projects
|
|
60
|
-
- Based on web standards
|
|
118
|
+
A reusable toggle for boolean values with sync and persistence features.
|
|
61
119
|
|
|
62
|
-
|
|
120
|
+
```html
|
|
121
|
+
<toggle-switch
|
|
122
|
+
onLabel="On"
|
|
123
|
+
offLabel="Off"
|
|
124
|
+
name="my-toggle"
|
|
125
|
+
storage-key="my-setting"
|
|
126
|
+
></toggle-switch>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### DataTable
|
|
130
|
+
|
|
131
|
+
A sortable, paginated data table with search and custom actions.
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<data-table
|
|
135
|
+
.columns="${columns}"
|
|
136
|
+
.data="${data}"
|
|
137
|
+
searchable
|
|
138
|
+
paginated
|
|
139
|
+
></data-table>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### ActionMenu
|
|
143
|
+
|
|
144
|
+
A dropdown menu for row-level actions in tables.
|
|
145
|
+
|
|
146
|
+
```html
|
|
147
|
+
<action-menu
|
|
148
|
+
.actions=${[
|
|
149
|
+
{ id: 'edit', label: 'Edit' },
|
|
150
|
+
{ id: 'delete', label: 'Delete', variant: 'danger' }
|
|
151
|
+
]}
|
|
152
|
+
></action-menu>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Button
|
|
156
|
+
|
|
157
|
+
A simple button with different variations to handle click events.
|
|
158
|
+
|
|
159
|
+
```html
|
|
160
|
+
<trailhand-button @click="${handleClick}" variant="primary" size="large">
|
|
161
|
+
<trailhand-icon name="globe" slot="icon-left"></trailhand-icon>
|
|
162
|
+
Primary
|
|
163
|
+
<trailhand-icon name="globe" slot="icon-right"></trailhand-icon>
|
|
164
|
+
</trailhand-button>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Testing
|
|
63
168
|
|
|
64
|
-
|
|
169
|
+
This component library will serve as the foundation for future projects, thus it is important to ensure that these components are well tested. Thankfully, Storybook provides many useful tools to test the components using various methods.
|
|
65
170
|
|
|
66
|
-
|
|
171
|
+
### Render Tests
|
|
67
172
|
|
|
68
|
-
|
|
173
|
+
Render tests (smoke tests), as one might expect, simply tes that the component renders as desired. These tests serve to find any errors that would cause the component to fail on render. Storybook turns each story into a render test. By adding stories to represent the various states of a component, you can confirm that the component will render in that state.
|
|
69
174
|
|
|
70
|
-
|
|
175
|
+
### Interaction Tests
|
|
176
|
+
|
|
177
|
+
After confirming that a component renders properly, you would likely next want to test that it behaves properly. These interaction tests can be written by adding a new story for the interaction you are testing, and then using the "play" method provided by Storybook to simulate user interactions and make assumptions against expected results.
|
|
178
|
+
|
|
179
|
+
### Accessibility Tests
|
|
180
|
+
|
|
181
|
+
Storybook also provides addons to check components against accessibility rules. This ensures components meet certain standards. The configuration for which rules are applied as well as the result of not meeting said rules can be set in .storybook/preview.js. These properties can also be set at the Component and Story levels in case secific rulesets need to be applied or removed.
|
|
182
|
+
|
|
183
|
+
### Visual Tests
|
|
184
|
+
|
|
185
|
+
Visual tests compare snapshots taken of components to catch unexpected visual changes. The Storybook developers provide a platform to run and manage these tests called Chromatic.
|
|
186
|
+
|
|
187
|
+
### Unit Tests
|
|
188
|
+
|
|
189
|
+
The testing methods listed above are great for ensuring user-visible behavior. However, there may be things that need to be tested that are not captured in the methods above, and for that we can use Vitest unit tests. Storybook can confirm visible outcomes, however, to truly test the buisness logic in the component or in associated helpers unit tests are required.
|
|
190
|
+
|
|
191
|
+
### Running the tests
|
|
192
|
+
|
|
193
|
+
Tests can be executed via the Storybook UI or in the command line.
|
|
194
|
+
|
|
195
|
+
#### Via Storybook
|
|
196
|
+
|
|
197
|
+
To run tests via the Storybook UI, first run
|
|
71
198
|
|
|
72
199
|
```bash
|
|
73
|
-
npm
|
|
200
|
+
npm run storybook
|
|
74
201
|
```
|
|
75
202
|
|
|
76
|
-
|
|
77
|
-
- Framework: `@storybook/web-components-vite`
|
|
78
|
-
- Addons: `addon-essentials`, `addon-a11y`
|
|
79
|
-
- ES Modules: `"type": "module"` in package.json
|
|
80
|
-
- Version: 8.6.14 (for Node.js v20.18.0 compatibility)
|
|
203
|
+
In the bottom left hand corner of the UI, you can open a menu to run tests and view test results.
|
|
81
204
|
|
|
82
|
-
|
|
205
|
+

|
|
83
206
|
|
|
84
|
-
|
|
207
|
+
You can also view test results for specific stories in the playground for that story.
|
|
85
208
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
209
|
+

|
|
210
|
+
|
|
211
|
+

|
|
212
|
+
|
|
213
|
+

|
|
214
|
+
|
|
215
|
+
#### Via the command line
|
|
216
|
+
|
|
217
|
+
To run render, interaction and accessibility tests via the command line run the following command
|
|
91
218
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
219
|
+
```bash
|
|
220
|
+
npm run test:storybook
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
To run unit tests via the command line run the following command
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
npm run test:unit
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
To run both storybook and unit tests via the command line run the following command
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
npm run test
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
To run visual tests via the command line ensure CHROMATIC_PROJECT_TOKEN is added to your env and then run the following command
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
npm run chromatic
|
|
97
239
|
```
|
|
98
240
|
|
|
99
241
|
## Tech Stack
|
|
100
242
|
|
|
101
|
-
- **Lit Element** 3.
|
|
102
|
-
- **
|
|
103
|
-
- **
|
|
243
|
+
- **Lit Element** 3.x - Web component library
|
|
244
|
+
- **TypeScript** - Type safety
|
|
245
|
+
- **Vite** - Build tool
|
|
246
|
+
- **Storybook** 8.x - Component documentation
|
|
247
|
+
- **Vitest** - Testing framework
|
|
104
248
|
- **Node.js** v20.18.0+
|
|
249
|
+
|
|
250
|
+
## Web Components
|
|
251
|
+
|
|
252
|
+
This library uses **Lit Element** for building fast, lightweight web components. Web components are framework-agnostic and work with any JavaScript framework or vanilla JS.
|
|
253
|
+
|
|
254
|
+
### Benefits
|
|
255
|
+
|
|
256
|
+
- Framework agnostic
|
|
257
|
+
- Encapsulated styles and functionality
|
|
258
|
+
- Reusable across projects
|
|
259
|
+
- Based on web standards
|
|
260
|
+
- TypeScript support with full type definitions
|
|
261
|
+
|
|
262
|
+
Learn more at [lit.dev](https://lit.dev)
|
|
@@ -0,0 +1 @@
|
|
|
1
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,IAAI,cAAc;CAqFlC"}
|
|
@@ -63,7 +63,7 @@ export class ActionMenu extends LitElement {
|
|
|
63
63
|
this.dispatchEvent(new CustomEvent('action-click', {
|
|
64
64
|
bubbles: true,
|
|
65
65
|
composed: true,
|
|
66
|
-
detail: { action, resource: this.resource }
|
|
66
|
+
detail: { action, resource: this.resource },
|
|
67
67
|
}));
|
|
68
68
|
// Call action handler if provided
|
|
69
69
|
if (action.action && typeof action.action === 'function') {
|
|
@@ -110,7 +110,8 @@ export class ActionMenu extends LitElement {
|
|
|
110
110
|
return this.actions;
|
|
111
111
|
}
|
|
112
112
|
// Otherwise, try to get from resource.availableActions
|
|
113
|
-
if (this.resource &&
|
|
113
|
+
if (this.resource &&
|
|
114
|
+
typeof this.resource.availableActions !== 'undefined') {
|
|
114
115
|
return this.resource.availableActions || [];
|
|
115
116
|
}
|
|
116
117
|
return [];
|
|
@@ -122,7 +123,7 @@ export class ActionMenu extends LitElement {
|
|
|
122
123
|
render() {
|
|
123
124
|
const allActions = this._getActions();
|
|
124
125
|
// Filter by visibility and enabled status
|
|
125
|
-
let visibleActions = allActions.filter(action => {
|
|
126
|
+
let visibleActions = allActions.filter((action) => {
|
|
126
127
|
// Skip dividers in visibility check
|
|
127
128
|
if (action.divider)
|
|
128
129
|
return true;
|
|
@@ -162,29 +163,40 @@ export class ActionMenu extends LitElement {
|
|
|
162
163
|
${this._renderIcon()}
|
|
163
164
|
</button>
|
|
164
165
|
|
|
165
|
-
<div
|
|
166
|
-
${
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
166
|
+
<div
|
|
167
|
+
class="action-menu__dropdown ${this._isOpen
|
|
168
|
+
? 'action-menu__dropdown--open'
|
|
169
|
+
: ''}"
|
|
170
|
+
>
|
|
171
|
+
${visibleActions.length === 0
|
|
172
|
+
? html ` <div class="action-menu__empty">No actions available</div> `
|
|
173
|
+
: html `
|
|
174
|
+
<ul class="action-menu__list" role="menu">
|
|
175
|
+
${visibleActions.map((action) => html `
|
|
176
|
+
${action.divider
|
|
177
|
+
? html `
|
|
178
|
+
<li
|
|
179
|
+
class="action-menu__divider"
|
|
180
|
+
role="separator"
|
|
181
|
+
></li>
|
|
182
|
+
`
|
|
183
|
+
: html `
|
|
184
|
+
<li class="action-menu__item" role="none">
|
|
185
|
+
<button
|
|
186
|
+
class="action-menu__action ${action.danger
|
|
187
|
+
? 'action-menu__action--danger'
|
|
188
|
+
: ''}"
|
|
189
|
+
?disabled=${!this._isActionEnabled(action)}
|
|
190
|
+
@click=${(e) => this._handleActionClick(e, action)}
|
|
191
|
+
role="menuitem"
|
|
192
|
+
>
|
|
193
|
+
${action.label}
|
|
194
|
+
</button>
|
|
195
|
+
</li>
|
|
196
|
+
`}
|
|
197
|
+
`)}
|
|
198
|
+
</ul>
|
|
199
|
+
`}
|
|
188
200
|
</div>
|
|
189
201
|
`;
|
|
190
202
|
}
|
|
@@ -202,17 +214,17 @@ ActionMenu.styles = css `
|
|
|
202
214
|
width: 32px;
|
|
203
215
|
height: 32px;
|
|
204
216
|
padding: 0;
|
|
205
|
-
border: 1px solid var(--border, #
|
|
217
|
+
border: 1px solid var(--border, var(--color-border, #D7D7D7));
|
|
206
218
|
border-radius: 4px;
|
|
207
|
-
background-color: var(--body-bg, #
|
|
208
|
-
color: var(--body-text, #
|
|
219
|
+
background-color: var(--body-bg, var(--color-white, #FFFFFF));
|
|
220
|
+
color: var(--body-text, var(--color-text-primary, #212121));
|
|
209
221
|
cursor: pointer;
|
|
210
222
|
transition: all 0.2s;
|
|
211
223
|
}
|
|
212
224
|
|
|
213
225
|
.action-menu__button:hover:not(:disabled) {
|
|
214
|
-
background-color: var(--sortable-table-row-hover-bg, #
|
|
215
|
-
border-color: var(--link, #
|
|
226
|
+
background-color: var(--sortable-table-row-hover-bg, var(--color-grey-100, #FAFAFA));
|
|
227
|
+
border-color: var(--link, var(--color-primary, #3d98d3));
|
|
216
228
|
}
|
|
217
229
|
|
|
218
230
|
.action-menu__button:disabled {
|
|
@@ -231,8 +243,8 @@ ActionMenu.styles = css `
|
|
|
231
243
|
top: 100%;
|
|
232
244
|
margin-top: 4px;
|
|
233
245
|
min-width: 180px;
|
|
234
|
-
background-color: var(--body-bg, #
|
|
235
|
-
border: 1px solid var(--border, #
|
|
246
|
+
background-color: var(--body-bg, var(--color-white, #FFFFFF));
|
|
247
|
+
border: 1px solid var(--border, var(--color-border, #D7D7D7));
|
|
236
248
|
border-radius: 4px;
|
|
237
249
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
238
250
|
z-index: 1000;
|
|
@@ -267,7 +279,7 @@ ActionMenu.styles = css `
|
|
|
267
279
|
padding: 0.5rem 1rem;
|
|
268
280
|
border: none;
|
|
269
281
|
background: none;
|
|
270
|
-
color: var(--body-text, #
|
|
282
|
+
color: var(--body-text, var(--color-text-primary, #212121));
|
|
271
283
|
font-size: 14px;
|
|
272
284
|
text-align: left;
|
|
273
285
|
cursor: pointer;
|
|
@@ -275,7 +287,7 @@ ActionMenu.styles = css `
|
|
|
275
287
|
}
|
|
276
288
|
|
|
277
289
|
.action-menu__action:hover:not(:disabled) {
|
|
278
|
-
background-color: var(--sortable-table-row-hover-bg, #
|
|
290
|
+
background-color: var(--sortable-table-row-hover-bg, var(--color-grey-100, #FAFAFA));
|
|
279
291
|
}
|
|
280
292
|
|
|
281
293
|
.action-menu__action:disabled {
|
|
@@ -284,23 +296,23 @@ ActionMenu.styles = css `
|
|
|
284
296
|
}
|
|
285
297
|
|
|
286
298
|
.action-menu__action--danger {
|
|
287
|
-
color: var(--error, #
|
|
299
|
+
color: var(--error, var(--color-error, #9F3A3A));
|
|
288
300
|
}
|
|
289
301
|
|
|
290
302
|
.action-menu__action--danger:hover:not(:disabled) {
|
|
291
|
-
background-color: rgba(
|
|
303
|
+
background-color: rgba(159, 58, 58, 0.1);
|
|
292
304
|
}
|
|
293
305
|
|
|
294
306
|
.action-menu__divider {
|
|
295
307
|
height: 1px;
|
|
296
308
|
margin: 0.5rem 0;
|
|
297
|
-
background-color: var(--border, #
|
|
309
|
+
background-color: var(--border, var(--color-border, #D7D7D7));
|
|
298
310
|
}
|
|
299
311
|
|
|
300
312
|
.action-menu__empty {
|
|
301
313
|
padding: 1rem;
|
|
302
314
|
text-align: center;
|
|
303
|
-
color: var(--muted, #
|
|
315
|
+
color: var(--muted, var(--color-text-muted, #8D8D8D));
|
|
304
316
|
font-size: 13px;
|
|
305
317
|
}
|
|
306
318
|
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-menu.js","sourceRoot":"","sources":["../../../src/components/action-menu/action-menu.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAsBpD;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IAmIxC;QACE,KAAK,EAAE,CAAC;QAlIV,YAAO,GAAqB,EAAE,CAAC;QAG/B,aAAQ,GAAiB,EAAE,CAAC;QAG5B,aAAQ,GAAG,KAAK,CAAC;QAGT,YAAO,GAAG,KAAK,CAAC;QA0HtB,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IAEQ,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC;IACpE,CAAC;IAEQ,oBAAoB;QA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AA6B;oBAC/B,CAAC,CAAC,EAAE;0CACM,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;uCACjC,CAAC,CAAQ,EAAE,EAAE,CACpB,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,MAAM,CAAC;;;gCAGlC,MAAM,CAAC,KAAK;;;yBAGnB;mBACN,CACF;;aAEJ;;KAER,CAAC;IACJ,CAAC;;AAhUe,iBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkH3B,AAlHqB,CAkHpB;AA/HF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;2CACK;AAG/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACC;AAG5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CACX;AAGT;IADP,KAAK,EAAE;2CACgB;AAuU1B,uBAAuB;AACvB,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/action-menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/action-menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
export interface ButtonProps {
|
|
3
|
+
variant: 'primary' | 'secondary' | 'alternate' | 'destructive' | 'confirmation';
|
|
4
|
+
size: 'small' | 'medium' | 'large';
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
type: 'button' | 'submit' | 'reset';
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class Button extends LitElement {
|
|
10
|
+
variant: 'primary' | 'secondary' | 'alternate' | 'destructive' | 'confirmation';
|
|
11
|
+
size: 'small' | 'medium' | 'large';
|
|
12
|
+
name: string;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
type: 'button' | 'submit' | 'reset';
|
|
15
|
+
static styles: import("lit").CSSResult;
|
|
16
|
+
updated(): void;
|
|
17
|
+
private handleClick;
|
|
18
|
+
render(): TemplateResult;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAI5D,MAAM,WAAW,WAAW;IAC1B,OAAO,EACH,SAAS,GACT,WAAW,GACX,WAAW,GACX,aAAa,GACb,cAAc,CAAC;IACnB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,MAAO,SAAQ,UAAU;IAEpC,OAAO,EACH,SAAS,GACT,WAAW,GACX,WAAW,GACX,aAAa,GACb,cAAc,CAAa;IAG/B,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAG9C,IAAI,SAAM;IAGV,QAAQ,UAAS;IAGjB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAY;IAE/C,OAAgB,MAAM,0BAwGpB;IAEF,OAAO;IAQP,OAAO,CAAC,WAAW;IAmBV,MAAM,IAAI,cAAc;CA0BlC"}
|