@daikin-oss/design-system-web-components 0.0.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/LICENSE +21 -0
- package/README.md +157 -0
- package/dist/_virtual/_tslib.js +31 -0
- package/dist/_virtual/_tslib.js.map +1 -0
- package/dist/colors.d.ts +70 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +81 -0
- package/dist/colors.js.map +1 -0
- package/dist/components/button/button.css.js +7 -0
- package/dist/components/button/button.css.js.map +1 -0
- package/dist/components/button/daikin-button.d.ts +28 -0
- package/dist/components/button/daikin-button.d.ts.map +1 -0
- package/dist/components/button/daikin-button.js +125 -0
- package/dist/components/button/daikin-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/components/button/stories/common.d.ts +15 -0
- package/dist/components/button/stories/common.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/node_modules/@daikinlab/dds-tokens/build/js/DKN/Light/variables.js +66 -0
- package/dist/node_modules/@daikinlab/dds-tokens/build/js/DKN/Light/variables.js.map +1 -0
- package/dist/node_modules/@lit/reactive-element/node/css-tag.js +9 -0
- package/dist/node_modules/@lit/reactive-element/node/css-tag.js.map +1 -0
- package/dist/node_modules/@lit/reactive-element/node/decorators/custom-element.js +9 -0
- package/dist/node_modules/@lit/reactive-element/node/decorators/custom-element.js.map +1 -0
- package/dist/node_modules/@lit/reactive-element/node/decorators/property.js +9 -0
- package/dist/node_modules/@lit/reactive-element/node/decorators/property.js.map +1 -0
- package/dist/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js +6 -0
- package/dist/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js.map +1 -0
- package/dist/node_modules/@lit/reactive-element/node/reactive-element.js +12 -0
- package/dist/node_modules/@lit/reactive-element/node/reactive-element.js.map +1 -0
- package/dist/node_modules/@lit-labs/ssr-dom-shim/index.js +122 -0
- package/dist/node_modules/@lit-labs/ssr-dom-shim/index.js.map +1 -0
- package/dist/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js +85 -0
- package/dist/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js.map +1 -0
- package/dist/node_modules/@netlify/classnames-template-literals/dist/classnames-template-literals.esm.js +13 -0
- package/dist/node_modules/@netlify/classnames-template-literals/dist/classnames-template-literals.esm.js.map +1 -0
- package/dist/node_modules/lit-element/lit-element.js +13 -0
- package/dist/node_modules/lit-element/lit-element.js.map +1 -0
- package/dist/node_modules/lit-html/node/lit-html.js +9 -0
- package/dist/node_modules/lit-html/node/lit-html.js.map +1 -0
- package/dist/node_modules/style-inject/dist/style-inject.es.js +29 -0
- package/dist/node_modules/style-inject/dist/style-inject.es.js.map +1 -0
- package/dist/tailwind.css.js +7 -0
- package/dist/tailwind.css.js.map +1 -0
- package/lib/_virtual/_tslib.js +33 -0
- package/lib/_virtual/_tslib.js.map +1 -0
- package/lib/colors.d.ts +70 -0
- package/lib/colors.d.ts.map +1 -0
- package/lib/colors.js +83 -0
- package/lib/colors.js.map +1 -0
- package/lib/components/button/button.css.js +9 -0
- package/lib/components/button/button.css.js.map +1 -0
- package/lib/components/button/daikin-button.d.ts +28 -0
- package/lib/components/button/daikin-button.d.ts.map +1 -0
- package/lib/components/button/daikin-button.js +127 -0
- package/lib/components/button/daikin-button.js.map +1 -0
- package/lib/components/button/index.d.ts +2 -0
- package/lib/components/button/index.d.ts.map +1 -0
- package/lib/components/button/index.js +5 -0
- package/lib/components/button/index.js.map +1 -0
- package/lib/components/button/stories/common.d.ts +15 -0
- package/lib/components/button/stories/common.d.ts.map +1 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +5 -0
- package/lib/components/index.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -0
- package/lib/node_modules/@daikinlab/dds-tokens/build/js/DKN/Light/variables.js +125 -0
- package/lib/node_modules/@daikinlab/dds-tokens/build/js/DKN/Light/variables.js.map +1 -0
- package/lib/node_modules/@lit/reactive-element/node/css-tag.js +16 -0
- package/lib/node_modules/@lit/reactive-element/node/css-tag.js.map +1 -0
- package/lib/node_modules/@lit/reactive-element/node/decorators/custom-element.js +11 -0
- package/lib/node_modules/@lit/reactive-element/node/decorators/custom-element.js.map +1 -0
- package/lib/node_modules/@lit/reactive-element/node/decorators/property.js +11 -0
- package/lib/node_modules/@lit/reactive-element/node/decorators/property.js.map +1 -0
- package/lib/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js +8 -0
- package/lib/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js.map +1 -0
- package/lib/node_modules/@lit/reactive-element/node/reactive-element.js +21 -0
- package/lib/node_modules/@lit/reactive-element/node/reactive-element.js.map +1 -0
- package/lib/node_modules/@lit-labs/ssr-dom-shim/index.js +126 -0
- package/lib/node_modules/@lit-labs/ssr-dom-shim/index.js.map +1 -0
- package/lib/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js +87 -0
- package/lib/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js.map +1 -0
- package/lib/node_modules/@netlify/classnames-template-literals/dist/classnames-template-literals.esm.js +15 -0
- package/lib/node_modules/@netlify/classnames-template-literals/dist/classnames-template-literals.esm.js.map +1 -0
- package/lib/node_modules/lit-element/lit-element.js +20 -0
- package/lib/node_modules/lit-element/lit-element.js.map +1 -0
- package/lib/node_modules/lit-html/node/lit-html.js +14 -0
- package/lib/node_modules/lit-html/node/lit-html.js.map +1 -0
- package/lib/node_modules/style-inject/dist/style-inject.es.js +31 -0
- package/lib/node_modules/style-inject/dist/style-inject.es.js.map +1 -0
- package/lib/tailwind.css.js +9 -0
- package/lib/tailwind.css.js.map +1 -0
- package/package.json +86 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 daikinOSS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Daikin Design System - Web Components
|
|
2
|
+
|
|
3
|
+
This project is an implementation of the Daikin Design Kit using web components.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
Install dependencies:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Build
|
|
14
|
+
|
|
15
|
+
Rollup is used to transform TypeScript code into JavaScript that runs in modern browsers.
|
|
16
|
+
Tailwind classes are also purged.
|
|
17
|
+
|
|
18
|
+
Build components and output in /dist:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm run build
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Documentation
|
|
25
|
+
|
|
26
|
+
Storybook is used to document design system components/tools/examples.
|
|
27
|
+
|
|
28
|
+
To run in development:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm run storybook
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
To produce distributable files in /storybook-static folder:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run storybook:build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Linting
|
|
41
|
+
|
|
42
|
+
Linting is done by ESLint for general linting of TypeScript and JavaScript, and [lit-analyzer](https://www.npmjs.com/package/lit-analyzer) to type check bindings in lit-html templates.
|
|
43
|
+
|
|
44
|
+
To lint the project run:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm run lint
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Testing
|
|
51
|
+
|
|
52
|
+
Visual regression testing is done by a combination of jest and puppeteer.
|
|
53
|
+
Currently, web components has full support in most major frameworks [except for React](https://custom-elements-everywhere.com/).
|
|
54
|
+
As such, we test both web components by themselves, and also test when imported by React:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm run test
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Design Tokens
|
|
61
|
+
|
|
62
|
+
1. **Source of Truth**: The `tokens` we use is the foundation of our design styles and was grabbed from https://github.com/dsv-rp/dds-tokens/tree/main.
|
|
63
|
+
|
|
64
|
+
2. **Using in Components**: For the most part, we use the js variables to apply as the default style:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
import {
|
|
68
|
+
buttonColorBackgroundPrimaryActive
|
|
69
|
+
} from '@daikinlab/dds-tokens/js/daikin/Light/variables.js';
|
|
70
|
+
|
|
71
|
+
class DaikinButton extends LitElement implements DaikinButtonProps {
|
|
72
|
+
static styles = css`
|
|
73
|
+
:host {
|
|
74
|
+
--defaultButtonColorBackgroundPrimaryActive: ${unsafeCSS(
|
|
75
|
+
buttonColorBackgroundPrimaryActive
|
|
76
|
+
)};
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
...rest of the code
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Usage
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
import '@daikin-zen/design-system-web-components/dist/components/button/index.js';
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
By default, out-of-the-box, the styles are for Daikin brand in light mode.
|
|
91
|
+
|
|
92
|
+
### Dark Mode and Brands/Themes
|
|
93
|
+
|
|
94
|
+
For dark-mode support and non-daikin brands, you need to add the `tokens` package and include the CSS reference in your html:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
npm install '@daikinlab/dds-tokens
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Dark Mode
|
|
101
|
+
|
|
102
|
+
Reference the CSS in HTML:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
<link rel="stylesheet" href="node_modules/@daikinlab/dds-tokens/build/css/DKN/Dark/buttons.css" media="(prefers-color-scheme: dark)">
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Using CSS `@import` with `prefers-color-scheme`:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
@import '@daikinlab/dds-tokens/css/daikin/Dark/buttons.css'
|
|
112
|
+
(prefers-color-scheme: dark);
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### Other brands/themes
|
|
117
|
+
|
|
118
|
+
Reference the CSS in HTML:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
<link rel="stylesheet" href="node_modules/@daikinlab/dds-tokens/build/css/AAF/Dark/buttons.css" media="(prefers-color-scheme: light)">
|
|
122
|
+
<link rel="stylesheet" href="node_modules/@daikinlab/dds-tokens/build/css/AAF/Dark/buttons.css" media="(prefers-color-scheme: dark)">
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Using CSS `@import` with `prefers-color-scheme`:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
@import '@daikinlab/dds-tokens/css/aaf/Light/buttons.css'
|
|
129
|
+
(prefers-color-scheme: light);
|
|
130
|
+
@import '@daikinlab/dds-tokens/css/aaf/Dark/buttons.css'
|
|
131
|
+
(prefers-color-scheme: dark);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Tailwind
|
|
135
|
+
|
|
136
|
+
There is a custom `daikinPlugin` managed [here](https://github.com/daikin-dsv/tailwind)
|
|
137
|
+
|
|
138
|
+
### Using with VSCode
|
|
139
|
+
|
|
140
|
+
If you are using VSCode, there is a great [extension](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) you can use for auto-complete
|
|
141
|
+
|
|
142
|
+
Add the following to your VSCode `settings.json` file:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"editor.quickSuggestions": {
|
|
147
|
+
"other": true,
|
|
148
|
+
"comments": false,
|
|
149
|
+
"strings": true
|
|
150
|
+
},
|
|
151
|
+
"tailwindCSS.experimental.classRegex": ["ctl[(]`([^`]*)"]
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
You may need to set the regex if using a library like [classnames-template-literals](https://github.com/netlify/classnames-template-literals)
|
|
156
|
+
|
|
157
|
+
References [Daikin Design Kit](https://www.figma.com/file/VyaaU8Ta9yzyf0PsURWSSf/DDS%3A-Design-Kit?node-id=2421%3A7943)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
function __decorate(decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
26
|
+
var e = new Error(message);
|
|
27
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { __decorate };
|
|
31
|
+
//# sourceMappingURL=_tslib.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_tslib.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/colors.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const colors: {
|
|
2
|
+
daikinBlue: {
|
|
3
|
+
50: string;
|
|
4
|
+
100: string;
|
|
5
|
+
200: string;
|
|
6
|
+
300: string;
|
|
7
|
+
400: string;
|
|
8
|
+
500: string;
|
|
9
|
+
600: string;
|
|
10
|
+
700: string;
|
|
11
|
+
800: string;
|
|
12
|
+
900: string;
|
|
13
|
+
DEFAULT: string;
|
|
14
|
+
};
|
|
15
|
+
daikinNeutral: {
|
|
16
|
+
50: string;
|
|
17
|
+
100: string;
|
|
18
|
+
200: string;
|
|
19
|
+
300: string;
|
|
20
|
+
400: string;
|
|
21
|
+
500: string;
|
|
22
|
+
600: string;
|
|
23
|
+
700: string;
|
|
24
|
+
800: string;
|
|
25
|
+
900: string;
|
|
26
|
+
};
|
|
27
|
+
daikinRed: {
|
|
28
|
+
50: string;
|
|
29
|
+
100: string;
|
|
30
|
+
200: string;
|
|
31
|
+
300: string;
|
|
32
|
+
400: string;
|
|
33
|
+
500: string;
|
|
34
|
+
600: string;
|
|
35
|
+
700: string;
|
|
36
|
+
800: string;
|
|
37
|
+
900: string;
|
|
38
|
+
1000: string;
|
|
39
|
+
DEFAULT: string;
|
|
40
|
+
};
|
|
41
|
+
daikinYellow: {
|
|
42
|
+
50: string;
|
|
43
|
+
100: string;
|
|
44
|
+
200: string;
|
|
45
|
+
300: string;
|
|
46
|
+
400: string;
|
|
47
|
+
500: string;
|
|
48
|
+
600: string;
|
|
49
|
+
700: string;
|
|
50
|
+
800: string;
|
|
51
|
+
900: string;
|
|
52
|
+
1000: string;
|
|
53
|
+
DEFAULT: string;
|
|
54
|
+
};
|
|
55
|
+
daikinGreen: {
|
|
56
|
+
50: string;
|
|
57
|
+
100: string;
|
|
58
|
+
200: string;
|
|
59
|
+
300: string;
|
|
60
|
+
400: string;
|
|
61
|
+
500: string;
|
|
62
|
+
600: string;
|
|
63
|
+
700: string;
|
|
64
|
+
800: string;
|
|
65
|
+
900: string;
|
|
66
|
+
1000: string;
|
|
67
|
+
DEFAULT: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAmEA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoElB,CAAC"}
|
package/dist/colors.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { colorBlue10, colorBlue20, colorBlue30, colorBlue50, colorBlue70, colorBlue80, colorBlue90, colorBlue100, colorGrey10, colorGrey20, colorGrey30, colorGrey40, colorGrey50, colorGrey60, colorGrey80, colorGrey100, colorRed10, colorRed20, colorRed30, colorRed40, colorRed50, colorRed70, colorRed80, colorRed90, colorRed100, colorRed110, colorYellow10, colorYellow20, colorYellow30, colorYellow40, colorYellow60, colorYellow70, colorYellow80, colorYellow90, colorYellow100, colorYellow110, colorGreen10, colorGreen20, colorGreen30, colorGreen40, colorGreen50, colorGreen70, colorGreen80, colorGreen90, colorGreen100, colorGreen110, colorBrandPrimary, colorBlue40, colorGrey90, colorGrey70, colorRed60, colorYellow50, colorGreen60 } from './node_modules/@daikinlab/dds-tokens/build/js/DKN/Light/variables.js';
|
|
2
|
+
|
|
3
|
+
const DAIKIN_PRIMARY_BLUE = colorBrandPrimary;
|
|
4
|
+
const DAIKIN_SECONDARY_BLUE = colorBlue40;
|
|
5
|
+
const DAIKIN_DARK_GREY = colorGrey90;
|
|
6
|
+
const DAIKIN_MEDIUM_GREY = colorGrey70;
|
|
7
|
+
const DAIKIN_NEGATIVE = colorRed60;
|
|
8
|
+
const DAIKIN_WARNING = colorYellow50;
|
|
9
|
+
const DAIKIN_POSITIVE = colorGreen60;
|
|
10
|
+
const colors = {
|
|
11
|
+
daikinBlue: {
|
|
12
|
+
50: colorBlue10,
|
|
13
|
+
100: colorBlue20,
|
|
14
|
+
200: colorBlue30,
|
|
15
|
+
300: DAIKIN_SECONDARY_BLUE,
|
|
16
|
+
400: colorBlue50,
|
|
17
|
+
500: DAIKIN_PRIMARY_BLUE,
|
|
18
|
+
600: colorBlue70,
|
|
19
|
+
700: colorBlue80,
|
|
20
|
+
800: colorBlue90,
|
|
21
|
+
900: colorBlue100,
|
|
22
|
+
DEFAULT: DAIKIN_PRIMARY_BLUE
|
|
23
|
+
},
|
|
24
|
+
daikinNeutral: {
|
|
25
|
+
50: colorGrey10,
|
|
26
|
+
100: colorGrey20,
|
|
27
|
+
200: colorGrey30,
|
|
28
|
+
300: colorGrey40,
|
|
29
|
+
400: colorGrey50,
|
|
30
|
+
500: colorGrey60,
|
|
31
|
+
600: DAIKIN_MEDIUM_GREY,
|
|
32
|
+
700: colorGrey80,
|
|
33
|
+
800: DAIKIN_DARK_GREY,
|
|
34
|
+
900: colorGrey100
|
|
35
|
+
},
|
|
36
|
+
daikinRed: {
|
|
37
|
+
50: colorRed10,
|
|
38
|
+
100: colorRed20,
|
|
39
|
+
200: colorRed30,
|
|
40
|
+
300: colorRed40,
|
|
41
|
+
400: colorRed50,
|
|
42
|
+
500: DAIKIN_NEGATIVE,
|
|
43
|
+
600: colorRed70,
|
|
44
|
+
700: colorRed80,
|
|
45
|
+
800: colorRed90,
|
|
46
|
+
900: colorRed100,
|
|
47
|
+
1000: colorRed110,
|
|
48
|
+
DEFAULT: DAIKIN_NEGATIVE
|
|
49
|
+
},
|
|
50
|
+
daikinYellow: {
|
|
51
|
+
50: colorYellow10,
|
|
52
|
+
100: colorYellow20,
|
|
53
|
+
200: colorYellow30,
|
|
54
|
+
300: colorYellow40,
|
|
55
|
+
400: DAIKIN_WARNING,
|
|
56
|
+
500: colorYellow60,
|
|
57
|
+
600: colorYellow70,
|
|
58
|
+
700: colorYellow80,
|
|
59
|
+
800: colorYellow90,
|
|
60
|
+
900: colorYellow100,
|
|
61
|
+
1000: colorYellow110,
|
|
62
|
+
DEFAULT: DAIKIN_WARNING
|
|
63
|
+
},
|
|
64
|
+
daikinGreen: {
|
|
65
|
+
50: colorGreen10,
|
|
66
|
+
100: colorGreen20,
|
|
67
|
+
200: colorGreen30,
|
|
68
|
+
300: colorGreen40,
|
|
69
|
+
400: colorGreen50,
|
|
70
|
+
500: DAIKIN_POSITIVE,
|
|
71
|
+
600: colorGreen70,
|
|
72
|
+
700: colorGreen80,
|
|
73
|
+
800: colorGreen90,
|
|
74
|
+
900: colorGreen100,
|
|
75
|
+
1000: colorGreen110,
|
|
76
|
+
DEFAULT: DAIKIN_POSITIVE
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { colors };
|
|
81
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sources":["../src/colors.ts"],"sourcesContent":["import {\n colorBrandPrimary, \n // 💣 Missing in tokens - fix later\n colorBlue40 as colorBrandSecondary,\n colorGrey70 as colorBrandMediumgrey,\n colorGrey90 as colorBrandDarkgrey,\n colorGreen60 as colorFeedbackPositive,\n colorYellow50 as colorFeedbackWarning,\n colorRed60 as colorFeedbackNegative,\n colorBlue10,\n colorBlue20,\n colorBlue30,\n colorBlue50,\n colorBlue70,\n colorBlue80,\n colorBlue90,\n colorBlue100,\n colorGrey10,\n colorGrey20,\n colorGrey30,\n colorGrey40,\n colorGrey50,\n colorGrey60,\n colorGrey80,\n colorGrey100,\n colorRed10,\n colorRed20,\n colorRed30,\n colorRed40,\n colorRed50,\n colorRed70,\n colorRed80,\n colorRed90,\n colorRed100,\n colorRed110,\n colorYellow10,\n colorYellow20,\n colorYellow30,\n colorYellow40,\n colorYellow70,\n colorYellow60,\n colorYellow80,\n colorYellow90,\n colorYellow100,\n colorYellow110,\n colorGreen10,\n colorGreen20,\n colorGreen30,\n colorGreen40,\n colorGreen50,\n colorGreen70,\n colorGreen80,\n colorGreen90,\n colorGreen100,\n colorGreen110\n} from '@daikinlab/dds-tokens/js/daikin/Light/variables.js';\n\nconst DAIKIN_PRIMARY_BLUE = colorBrandPrimary;\nconst DAIKIN_SECONDARY_BLUE = colorBrandSecondary;\n\nconst DAIKIN_DARK_GREY = colorBrandDarkgrey;\nconst DAIKIN_MEDIUM_GREY = colorBrandMediumgrey;\n\nconst DAIKIN_NEGATIVE = colorFeedbackNegative;\nconst DAIKIN_WARNING = colorFeedbackWarning;\nconst DAIKIN_POSITIVE = colorFeedbackPositive;\n\nexport const colors = {\n daikinBlue: {\n 50: colorBlue10,\n 100: colorBlue20,\n 200: colorBlue30,\n 300: DAIKIN_SECONDARY_BLUE,\n 400: colorBlue50,\n 500: DAIKIN_PRIMARY_BLUE,\n 600: colorBlue70,\n 700: colorBlue80,\n 800: colorBlue90,\n 900: colorBlue100,\n DEFAULT: DAIKIN_PRIMARY_BLUE\n },\n daikinNeutral: {\n 50: colorGrey10,\n 100: colorGrey20,\n 200: colorGrey30,\n 300: colorGrey40,\n 400: colorGrey50,\n 500: colorGrey60,\n 600: DAIKIN_MEDIUM_GREY,\n 700: colorGrey80,\n 800: DAIKIN_DARK_GREY,\n 900: colorGrey100\n },\n daikinRed: {\n 50: colorRed10,\n 100: colorRed20,\n 200: colorRed30,\n 300: colorRed40,\n 400: colorRed50,\n 500: DAIKIN_NEGATIVE,\n 600: colorRed70,\n 700: colorRed80,\n 800: colorRed90,\n 900: colorRed100,\n 1000: colorRed110,\n DEFAULT: DAIKIN_NEGATIVE\n },\n daikinYellow: {\n 50: colorYellow10,\n 100: colorYellow20,\n 200: colorYellow30,\n 300: colorYellow40,\n 400: DAIKIN_WARNING,\n 500: colorYellow60,\n 600: colorYellow70,\n 700: colorYellow80,\n 800: colorYellow90,\n 900: colorYellow100,\n 1000: colorYellow110,\n DEFAULT: DAIKIN_WARNING\n },\n daikinGreen: {\n 50: colorGreen10,\n 100: colorGreen20,\n 200: colorGreen30,\n 300: colorGreen40,\n 400: colorGreen50,\n 500: DAIKIN_POSITIVE,\n 600: colorGreen70,\n 700: colorGreen80,\n 800: colorGreen90,\n 900: colorGreen100,\n 1000: colorGreen110,\n DEFAULT: DAIKIN_POSITIVE\n }\n};\n"],"names":["colorBrandSecondary","colorBrandDarkgrey","colorBrandMediumgrey","colorFeedbackNegative","colorFeedbackWarning","colorFeedbackPositive"],"mappings":";;AAyDA,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAC9C,MAAM,qBAAqB,GAAGA,WAAmB,CAAC;AAElD,MAAM,gBAAgB,GAAGC,WAAkB,CAAC;AAC5C,MAAM,kBAAkB,GAAGC,WAAoB,CAAC;AAEhD,MAAM,eAAe,GAAGC,UAAqB,CAAC;AAC9C,MAAM,cAAc,GAAGC,aAAoB,CAAC;AAC5C,MAAM,eAAe,GAAGC,YAAqB,CAAC;AAEjC,MAAA,MAAM,GAAG;AAClB,IAAA,UAAU,EAAE;AACR,QAAA,EAAE,EAAE,WAAW;AACf,QAAA,GAAG,EAAE,WAAW;AAChB,QAAA,GAAG,EAAE,WAAW;AAChB,QAAA,GAAG,EAAE,qBAAqB;AAC1B,QAAA,GAAG,EAAE,WAAW;AAChB,QAAA,GAAG,EAAE,mBAAmB;AACxB,QAAA,GAAG,EAAE,WAAW;AAChB,QAAA,GAAG,EAAE,WAAW;AAChB,QAAA,GAAG,EAAE,WAAW;AAChB,QAAA,GAAG,EAAE,YAAY;AACjB,QAAA,OAAO,EAAE,mBAAmB;AAC/B,KAAA;AACD,IAAA,aAAa,EAAE;AACX,QAAA,EAAE,EAAE,WAAW;AACf,QAAA,GAAG,EAAE,WAAW;AAChB,QAA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AACpB,QAAA,GAAG,EAAE,YAAY;AACjB,QAAA,GAAG,EAAE,YAAY;AACjB,QAAA,GAAG,EAAE,YAAY;AACjB,QAAA,GAAG,EAAE,aAAa;AAClB,QAAA,IAAI,EAAE,aAAa;AACnB,QAAA,OAAO,EAAE,eAAe;AAC3B,KAAA;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from '../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".button{\n font-family:var(--fontFamilyBase);\n}\n\n.button-primary{\n background-color:var(\n --buttonColorBackgroundPrimaryActive,\n var(--defaultButtonColorBackgroundPrimaryActive)\n );\n color:white;\n}\n.button-primary:focus{\n background-color:var(\n --buttonColorBackgroundPrimaryFocus,\n var(--defaultButtonColorBackgroundPrimaryFocus)\n );\n}\n.button-primary:hover{\n background-color:var(\n --buttonColorBackgroundPrimaryHover,\n var(--defaultButtonColorBackgroundPrimaryHover)\n );\n}\n.button-primary:active{\n background-color:var(\n --buttonColorBackgroundPrimaryPress,\n var(--defaultButtonColorBackgroundPrimaryPress)\n );\n}\n.button-primary:disabled{\n background-color:var(\n --buttonColorBackgroundPrimaryDisabled,\n var(--defaultButtonColorBackgroundPrimaryDisabled)\n );\n}\n\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRvbi5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7SUFDSSxpQ0FBa0M7QUFDdEM7O0FBRUE7SUFDSTs7O0tBR0M7SUFDRCxXQUFZO0FBQ2hCO0FBQ0E7SUFDSTs7O0tBR0M7QUFDTDtBQUNBO0lBQ0k7OztLQUdDO0FBQ0w7QUFDQTtJQUNJOzs7S0FHQztBQUNMO0FBQ0E7SUFDSTs7O0tBR0M7QUFDTCIsImZpbGUiOiJidXR0b24uY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmJ1dHRvbiB7XG4gICAg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W5kUHJpbWFyeURpc2FibGVkLFxuICAgICAgICB2YXIoLS1kZWZhdWx0QnV0dG9uQ29sb3JCYWNrZ3JvdW5kUHJpbWFyeURpc2FibGVkKVxuICAgICk7XG59XG4iXX0= */";
|
|
4
|
+
styleInject(css_248z);
|
|
5
|
+
|
|
6
|
+
export { css_248z as default };
|
|
7
|
+
//# sourceMappingURL=button.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export interface DaikinButtonProps {
|
|
3
|
+
/**
|
|
4
|
+
* Type of action
|
|
5
|
+
*/
|
|
6
|
+
variant: 'primary' | 'secondary' | 'tertiary' | 'primary-danger';
|
|
7
|
+
/**
|
|
8
|
+
* Whether to show the disabled state
|
|
9
|
+
*/
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Primary UI component for user interaction
|
|
14
|
+
*/
|
|
15
|
+
declare class DaikinButton extends LitElement implements DaikinButtonProps {
|
|
16
|
+
static styles: import("lit").CSSResult;
|
|
17
|
+
variant: 'primary' | 'secondary' | 'tertiary' | 'primary-danger';
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
connectedCallback(): void;
|
|
20
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
'daikin-button': DaikinButton;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export default DaikinButton;
|
|
28
|
+
//# sourceMappingURL=daikin-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daikin-button.d.ts","sourceRoot":"","sources":["../../../src/components/button/daikin-button.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAwB,MAAM,KAAK,CAAC;AAuDvD,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,gBAAgB,CAAC;IACjE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,cACM,YAAa,SAAQ,UAAW,YAAW,iBAAiB;IAC9D,MAAM,CAAC,MAAM,0BAkBX;IAGF,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,gBAAgB,CAAC;IAGjE,QAAQ,UAAS;IAEjB,iBAAiB,IAAI,IAAI;IAmBzB,MAAM;CA0BT;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACJ;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { __decorate } from '../../_virtual/_tslib.js';
|
|
2
|
+
import { buttonColorBackgroundPrimaryActive, buttonColorBackgroundPrimaryFocus, buttonColorBackgroundPrimaryHover, buttonColorBackgroundPrimaryPress, buttonColorBackgroundPrimaryDisabled } from '../../node_modules/@daikinlab/dds-tokens/build/js/DKN/Light/variables.js';
|
|
3
|
+
import ctl from '../../node_modules/@netlify/classnames-template-literals/dist/classnames-template-literals.esm.js';
|
|
4
|
+
import '../../node_modules/@lit/reactive-element/node/reactive-element.js';
|
|
5
|
+
import { html as T } from '../../node_modules/lit-html/node/lit-html.js';
|
|
6
|
+
import { LitElement as s } from '../../node_modules/lit-element/lit-element.js';
|
|
7
|
+
import { customElement as e } from '../../node_modules/@lit/reactive-element/node/decorators/custom-element.js';
|
|
8
|
+
import { property as n } from '../../node_modules/@lit/reactive-element/node/decorators/property.js';
|
|
9
|
+
import '../../node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js';
|
|
10
|
+
import css_248z from '../../tailwind.css.js';
|
|
11
|
+
import css_248z$1 from './button.css.js';
|
|
12
|
+
import { css as i, unsafeCSS as r } from '../../node_modules/@lit/reactive-element/node/css-tag.js';
|
|
13
|
+
|
|
14
|
+
var DaikinButton_1;
|
|
15
|
+
const button = ctl(`
|
|
16
|
+
inline-block
|
|
17
|
+
font-daikinSerif
|
|
18
|
+
rounded-lg
|
|
19
|
+
text-base
|
|
20
|
+
px-4
|
|
21
|
+
py-2
|
|
22
|
+
shadow-lg
|
|
23
|
+
tracking-wide
|
|
24
|
+
disabled:cursor-default
|
|
25
|
+
disabled:shadow-none
|
|
26
|
+
|
|
27
|
+
md:py-3
|
|
28
|
+
md:px-6
|
|
29
|
+
`);
|
|
30
|
+
const buttonSecondary = ctl(`
|
|
31
|
+
border-2
|
|
32
|
+
bg-white
|
|
33
|
+
text-daikinBlue-500
|
|
34
|
+
border-daikinBlue-500
|
|
35
|
+
|
|
36
|
+
hover:bg-daikinBlue-100
|
|
37
|
+
|
|
38
|
+
disabled:bg-white
|
|
39
|
+
disabled:border-daikinNeutral-300
|
|
40
|
+
disabled:text-daikinNeutral-400
|
|
41
|
+
disabled:border
|
|
42
|
+
`);
|
|
43
|
+
const buttonTertiary = ctl(`
|
|
44
|
+
text-daikinBlue-400
|
|
45
|
+
bg-none
|
|
46
|
+
border-none
|
|
47
|
+
shadow-none
|
|
48
|
+
|
|
49
|
+
hover:bg-daikinNeutral-100
|
|
50
|
+
disabled:bg-transparent
|
|
51
|
+
disabled:text-daikinNeutral-400
|
|
52
|
+
`);
|
|
53
|
+
const buttonPrimaryDanger = ctl(`
|
|
54
|
+
bg-daikinRed
|
|
55
|
+
text-white
|
|
56
|
+
hover:bg-daikinRed-400
|
|
57
|
+
focus:bg-daikinRed-700
|
|
58
|
+
disabled:bg-daikinNeutral-300
|
|
59
|
+
`);
|
|
60
|
+
/**
|
|
61
|
+
* Primary UI component for user interaction
|
|
62
|
+
*/
|
|
63
|
+
let DaikinButton = DaikinButton_1 = class DaikinButton extends s {
|
|
64
|
+
constructor() {
|
|
65
|
+
super(...arguments);
|
|
66
|
+
this.disabled = false;
|
|
67
|
+
}
|
|
68
|
+
connectedCallback() {
|
|
69
|
+
super.connectedCallback();
|
|
70
|
+
const tailwind = new CSSStyleSheet();
|
|
71
|
+
tailwind.replace(css_248z);
|
|
72
|
+
const buttonStyles = new CSSStyleSheet();
|
|
73
|
+
buttonStyles.replaceSync(css_248z$1);
|
|
74
|
+
const defaultsVariables = new CSSStyleSheet();
|
|
75
|
+
defaultsVariables.replaceSync(DaikinButton_1.styles.cssText);
|
|
76
|
+
this.renderRoot.adoptedStyleSheets = [
|
|
77
|
+
tailwind,
|
|
78
|
+
defaultsVariables,
|
|
79
|
+
buttonStyles
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
let CN = `${button} `;
|
|
84
|
+
switch (this.variant) {
|
|
85
|
+
case 'primary':
|
|
86
|
+
CN += 'button-primary';
|
|
87
|
+
break;
|
|
88
|
+
case 'secondary':
|
|
89
|
+
CN += buttonSecondary;
|
|
90
|
+
break;
|
|
91
|
+
case 'tertiary':
|
|
92
|
+
CN += buttonTertiary;
|
|
93
|
+
break;
|
|
94
|
+
case 'primary-danger':
|
|
95
|
+
CN += buttonPrimaryDanger;
|
|
96
|
+
break;
|
|
97
|
+
default:
|
|
98
|
+
CN += 'button-primary';
|
|
99
|
+
}
|
|
100
|
+
return T `
|
|
101
|
+
<button class="${CN}" ?disabled="${this.disabled}">
|
|
102
|
+
<slot></slot>
|
|
103
|
+
</button>
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
DaikinButton.styles = i `
|
|
108
|
+
:host {
|
|
109
|
+
--defaultButtonColorBackgroundPrimaryActive: ${r(buttonColorBackgroundPrimaryActive)};
|
|
110
|
+
--defaultButtonColorBackgroundPrimaryFocus: ${r(buttonColorBackgroundPrimaryFocus)};
|
|
111
|
+
--defaultButtonColorBackgroundPrimaryHover: ${r(buttonColorBackgroundPrimaryHover)};
|
|
112
|
+
--defaultButtonColorBackgroundPrimaryPress: ${r(buttonColorBackgroundPrimaryPress)};
|
|
113
|
+
--defaultButtonColorBackgroundPrimaryDisabled: ${r(buttonColorBackgroundPrimaryDisabled)};
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
__decorate([
|
|
117
|
+
n({ type: String })
|
|
118
|
+
], DaikinButton.prototype, "variant", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
n({ type: Boolean, reflect: true })
|
|
121
|
+
], DaikinButton.prototype, "disabled", void 0);
|
|
122
|
+
DaikinButton = DaikinButton_1 = __decorate([
|
|
123
|
+
e('daikin-button')
|
|
124
|
+
], DaikinButton);
|
|
125
|
+
//# sourceMappingURL=daikin-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daikin-button.js","sources":["../../../src/components/button/daikin-button.ts"],"sourcesContent":["import {\n buttonColorBackgroundPrimaryActive,\n buttonColorBackgroundPrimaryFocus,\n buttonColorBackgroundPrimaryHover,\n buttonColorBackgroundPrimaryPress,\n buttonColorBackgroundPrimaryDisabled\n} from '@daikinlab/dds-tokens/js/daikin/Light/variables.js';\nimport ctl from '@netlify/classnames-template-literals';\nimport { LitElement, html, css, unsafeCSS } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport tailwindStyles from '../../tailwind.css';\nimport styles from './button.css';\n\nconst button = ctl(`\n inline-block\n font-daikinSerif\n rounded-lg \n text-base\n px-4\n py-2\n shadow-lg\n tracking-wide \n disabled:cursor-default \n disabled:shadow-none \n\n md:py-3\n md:px-6\n`);\n\nconst buttonSecondary = ctl(`\n border-2\n bg-white\n text-daikinBlue-500\n border-daikinBlue-500\n\n hover:bg-daikinBlue-100\n\n disabled:bg-white\n disabled:border-daikinNeutral-300\n disabled:text-daikinNeutral-400\n disabled:border\n`);\n\nconst buttonTertiary = ctl(`\n text-daikinBlue-400\n bg-none\n border-none\n shadow-none\n\n hover:bg-daikinNeutral-100\n disabled:bg-transparent\n disabled:text-daikinNeutral-400\n`);\n\nconst buttonPrimaryDanger = ctl(`\n bg-daikinRed\n text-white \n hover:bg-daikinRed-400\n focus:bg-daikinRed-700\n disabled:bg-daikinNeutral-300\n`);\n\nexport interface DaikinButtonProps {\n /**\n * Type of action\n */\n variant: 'primary' | 'secondary' | 'tertiary' | 'primary-danger';\n /**\n * Whether to show the disabled state\n */\n disabled?: boolean;\n}\n\n/**\n * Primary UI component for user interaction\n */\n@customElement('daikin-button')\nclass DaikinButton extends LitElement implements DaikinButtonProps {\n static styles = css`\n :host {\n --defaultButtonColorBackgroundPrimaryActive: ${unsafeCSS(\n buttonColorBackgroundPrimaryActive\n )};\n --defaultButtonColorBackgroundPrimaryFocus: ${unsafeCSS(\n buttonColorBackgroundPrimaryFocus\n )};\n --defaultButtonColorBackgroundPrimaryHover: ${unsafeCSS(\n buttonColorBackgroundPrimaryHover\n )};\n --defaultButtonColorBackgroundPrimaryPress: ${unsafeCSS(\n buttonColorBackgroundPrimaryPress\n )};\n --defaultButtonColorBackgroundPrimaryDisabled: ${unsafeCSS(\n buttonColorBackgroundPrimaryDisabled\n )};\n }\n `;\n\n @property({ type: String })\n variant: 'primary' | 'secondary' | 'tertiary' | 'primary-danger';\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n connectedCallback(): void {\n super.connectedCallback();\n\n const tailwind = new CSSStyleSheet();\n tailwind.replace(tailwindStyles);\n\n const buttonStyles = new CSSStyleSheet();\n buttonStyles.replaceSync(styles);\n\n const defaultsVariables = new CSSStyleSheet();\n defaultsVariables.replaceSync(DaikinButton.styles.cssText);\n\n (this.renderRoot as ShadowRoot).adoptedStyleSheets = [\n tailwind,\n defaultsVariables,\n buttonStyles\n ];\n }\n\n render() {\n let CN = `${button} `;\n\n switch (this.variant) {\n case 'primary':\n CN += 'button-primary';\n break;\n case 'secondary':\n CN += buttonSecondary;\n break;\n case 'tertiary':\n CN += buttonTertiary;\n break;\n case 'primary-danger':\n CN += buttonPrimaryDanger;\n break;\n default:\n CN += 'button-primary';\n }\n\n return html`\n <button class=\"${CN}\" ?disabled=\"${this.disabled}\">\n <slot></slot>\n </button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'daikin-button': DaikinButton;\n }\n}\n\nexport default DaikinButton;\n"],"names":["LitElement","tailwindStyles","styles","html","css","unsafeCSS","property","customElement"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,MAAM,GAAG,GAAG,CAAC,CAAA;;;;;;;;;;;;;;AAclB,CAAA,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,GAAG,CAAC,CAAA;;;;;;;;;;;;AAY3B,CAAA,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,GAAG,CAAC,CAAA;;;;;;;;;AAS1B,CAAA,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,GAAG,CAAC,CAAA;;;;;;AAM/B,CAAA,CAAC,CAAC;AAaH;;AAEG;AAEH,IAAM,YAAY,GAAA,cAAA,GAAlB,MAAM,YAAa,SAAQA,CAAU,CAAA;AAArC,IAAA,WAAA,GAAA;;QAyBI,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;KA+CpB;IA7CG,iBAAiB,GAAA;QACb,KAAK,CAAC,iBAAiB,EAAE,CAAC;AAE1B,QAAA,MAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;AACrC,QAAA,QAAQ,CAAC,OAAO,CAACC,QAAc,CAAC,CAAC;AAEjC,QAAA,MAAM,YAAY,GAAG,IAAI,aAAa,EAAE,CAAC;AACzC,QAAA,YAAY,CAAC,WAAW,CAACC,UAAM,CAAC,CAAC;AAEjC,QAAA,MAAM,iBAAiB,GAAG,IAAI,aAAa,EAAE,CAAC;QAC9C,iBAAiB,CAAC,WAAW,CAAC,cAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAE1D,QAAA,IAAI,CAAC,UAAyB,CAAC,kBAAkB,GAAG;YACjD,QAAQ;YACR,iBAAiB;YACjB,YAAY;SACf,CAAC;KACL;IAED,MAAM,G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Ae,CAAC;AACzB,CAAA,EAAA,YAAY,CAwEjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/web-components';
|
|
2
|
+
import type { DaikinButtonProps } from '../daikin-button';
|
|
3
|
+
export interface DaikinButtonStoryArgs extends DaikinButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Text input for users
|
|
6
|
+
*/
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
type Story = StoryObj<DaikinButtonStoryArgs>;
|
|
10
|
+
export declare const Primary: Story;
|
|
11
|
+
export declare const Secondary: Story;
|
|
12
|
+
export declare const Tertiary: Story;
|
|
13
|
+
export declare const PrimaryDanger: Story;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/components/button/stories/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC5D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,KAAK,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAE7C,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAEzB,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|