@quartzds/core 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +136 -0
- package/components/floating-ui.dom.esm.js +1402 -0
- package/components/floating-ui.dom.esm.js.map +1 -0
- package/components/helpers.js +174 -0
- package/components/helpers.js.map +1 -0
- package/components/icon.js +175 -0
- package/components/icon.js.map +1 -0
- package/components/index.d.ts +52 -0
- package/components/index.js +117 -0
- package/components/index.js.map +1 -0
- package/components/label.js +55 -0
- package/components/label.js.map +1 -0
- package/components/qds-button.d.ts +11 -0
- package/components/qds-button.js +148 -0
- package/components/qds-button.js.map +1 -0
- package/components/qds-checkbox.d.ts +11 -0
- package/components/qds-checkbox.js +156 -0
- package/components/qds-checkbox.js.map +1 -0
- package/components/qds-dropdown.d.ts +11 -0
- package/components/qds-dropdown.js +259 -0
- package/components/qds-dropdown.js.map +1 -0
- package/components/qds-icon.d.ts +11 -0
- package/components/qds-icon.js +13 -0
- package/components/qds-icon.js.map +1 -0
- package/components/qds-inline-link.d.ts +11 -0
- package/components/qds-inline-link.js +89 -0
- package/components/qds-inline-link.js.map +1 -0
- package/components/qds-input.d.ts +11 -0
- package/components/qds-input.js +244 -0
- package/components/qds-input.js.map +1 -0
- package/components/qds-label.d.ts +11 -0
- package/components/qds-label.js +13 -0
- package/components/qds-label.js.map +1 -0
- package/components/qds-radio.d.ts +11 -0
- package/components/qds-radio.js +109 -0
- package/components/qds-radio.js.map +1 -0
- package/components/qds-switch.d.ts +11 -0
- package/components/qds-switch.js +119 -0
- package/components/qds-switch.js.map +1 -0
- package/components/qds-title.d.ts +11 -0
- package/components/qds-title.js +94 -0
- package/components/qds-title.js.map +1 -0
- package/components/qds-tooltip.d.ts +11 -0
- package/components/qds-tooltip.js +325 -0
- package/components/qds-tooltip.js.map +1 -0
- package/dist/cjs/floating-ui.dom.esm-71fa96af.js +1410 -0
- package/dist/cjs/floating-ui.dom.esm-71fa96af.js.map +1 -0
- package/dist/cjs/helpers-0b23af3f.js +184 -0
- package/dist/cjs/helpers-0b23af3f.js.map +1 -0
- package/dist/cjs/index-f19b2823.js +2030 -0
- package/dist/cjs/index-f19b2823.js.map +1 -0
- package/dist/cjs/index.cjs.js +115 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/library-4803c801.js +62 -0
- package/dist/cjs/library-4803c801.js.map +1 -0
- package/dist/cjs/loader.cjs.js +29 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/qds-button.cjs.entry.js +110 -0
- package/dist/cjs/qds-button.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-checkbox.cjs.entry.js +116 -0
- package/dist/cjs/qds-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-dropdown.cjs.entry.js +227 -0
- package/dist/cjs/qds-dropdown.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-icon.cjs.entry.js +113 -0
- package/dist/cjs/qds-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-inline-link.cjs.entry.js +61 -0
- package/dist/cjs/qds-inline-link.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-input.cjs.entry.js +200 -0
- package/dist/cjs/qds-input.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-label.cjs.entry.js +39 -0
- package/dist/cjs/qds-label.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-radio.cjs.entry.js +74 -0
- package/dist/cjs/qds-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-switch.cjs.entry.js +79 -0
- package/dist/cjs/qds-switch.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-title.cjs.entry.js +66 -0
- package/dist/cjs/qds-title.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-tooltip.cjs.entry.js +284 -0
- package/dist/cjs/qds-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/qds.cjs.js +33 -0
- package/dist/cjs/qds.cjs.js.map +1 -0
- package/dist/custom-elements.json +3976 -0
- package/dist/docs.d.ts +148 -0
- package/dist/docs.json +3918 -0
- package/dist/esm/floating-ui.dom.esm-f96ac766.js +1402 -0
- package/dist/esm/floating-ui.dom.esm-f96ac766.js.map +1 -0
- package/dist/esm/helpers-5c189a19.js +174 -0
- package/dist/esm/helpers-5c189a19.js.map +1 -0
- package/dist/esm/index-1bc8e218.js +2000 -0
- package/dist/esm/index-1bc8e218.js.map +1 -0
- package/dist/esm/index.js +106 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/library-aa6893c0.js +58 -0
- package/dist/esm/library-aa6893c0.js.map +1 -0
- package/dist/esm/loader.js +25 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/qds-button.entry.js +106 -0
- package/dist/esm/qds-button.entry.js.map +1 -0
- package/dist/esm/qds-checkbox.entry.js +112 -0
- package/dist/esm/qds-checkbox.entry.js.map +1 -0
- package/dist/esm/qds-dropdown.entry.js +223 -0
- package/dist/esm/qds-dropdown.entry.js.map +1 -0
- package/dist/esm/qds-icon.entry.js +109 -0
- package/dist/esm/qds-icon.entry.js.map +1 -0
- package/dist/esm/qds-inline-link.entry.js +57 -0
- package/dist/esm/qds-inline-link.entry.js.map +1 -0
- package/dist/esm/qds-input.entry.js +196 -0
- package/dist/esm/qds-input.entry.js.map +1 -0
- package/dist/esm/qds-label.entry.js +35 -0
- package/dist/esm/qds-label.entry.js.map +1 -0
- package/dist/esm/qds-radio.entry.js +70 -0
- package/dist/esm/qds-radio.entry.js.map +1 -0
- package/dist/esm/qds-switch.entry.js +75 -0
- package/dist/esm/qds-switch.entry.js.map +1 -0
- package/dist/esm/qds-title.entry.js +62 -0
- package/dist/esm/qds-title.entry.js.map +1 -0
- package/dist/esm/qds-tooltip.entry.js +280 -0
- package/dist/esm/qds-tooltip.entry.js.map +1 -0
- package/dist/esm/qds.js +28 -0
- package/dist/esm/qds.js.map +1 -0
- package/dist/types/components/button/button.d.ts +209 -0
- package/dist/types/components/checkbox/checkbox.d.ts +136 -0
- package/dist/types/components/create-story.d.ts +5 -0
- package/dist/types/components/dropdown/dropdown.d.ts +135 -0
- package/dist/types/components/icon/default-library.d.ts +4 -0
- package/dist/types/components/icon/icon.d.ts +31 -0
- package/dist/types/components/icon/library.d.ts +19 -0
- package/dist/types/components/icon/request.d.ts +12 -0
- package/dist/types/components/icon/system-library.d.ts +4 -0
- package/dist/types/components/inline-link/inline-link.d.ts +208 -0
- package/dist/types/components/input/input.d.ts +386 -0
- package/dist/types/components/label/label.d.ts +33 -0
- package/dist/types/components/radio/radio.d.ts +110 -0
- package/dist/types/components/switch/switch.d.ts +115 -0
- package/dist/types/components/title/title.d.ts +42 -0
- package/dist/types/components/tooltip/tooltip.d.ts +147 -0
- package/dist/types/components.d.ts +1692 -0
- package/dist/types/helpers.d.ts +49 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/qds-test.d.ts +18 -0
- package/dist/types/stencil-public-runtime.d.ts +1638 -0
- package/dist/types/utils.d.ts +65 -0
- package/dist/vscode.html-custom-data.json +947 -0
- package/hydrate/index.d.ts +218 -0
- package/hydrate/index.js +9690 -0
- package/hydrate/package.json +6 -0
- package/loader/cdn.js +7 -0
- package/loader/index.cjs.js +7 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +7 -0
- package/loader/index.js +8 -0
- package/loader/package.json +11 -0
- package/package.json +231 -0
- package/styles/core.css +379 -0
package/README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SPDX-FileCopyrightText: © 2023 Schneider Electric
|
|
3
|
+
|
|
4
|
+
SPDX-License-Identifier: LGPL-2.1-only
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
# `@quartzds/core`
|
|
8
|
+
|
|
9
|
+
[![NPM Package][npm-badge]][npm-link]
|
|
10
|
+
[![License][license-badge]][license]
|
|
11
|
+
|
|
12
|
+
The Quartz Core package has the web components that make up the reusable
|
|
13
|
+
UI building blocks of the [Quartz design system][]. These components are designed
|
|
14
|
+
to be used in traditional frontend view libraries/frameworks (such as React,
|
|
15
|
+
Angular, or Vue) or on their own through traditional JavaScript in the browser.
|
|
16
|
+
|
|
17
|
+
## 💿 Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @quartzds/core
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 📖 Usage
|
|
24
|
+
|
|
25
|
+
### Vanilla HTML
|
|
26
|
+
|
|
27
|
+
The easiest way to start using the Quartz Core is by adding `link` and `script` tags to the CDN.
|
|
28
|
+
|
|
29
|
+
First, the fonts:
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<link
|
|
33
|
+
rel="stylesheet"
|
|
34
|
+
href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap"
|
|
35
|
+
/>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Next, the platform and theme CSS custom properties:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<link
|
|
42
|
+
rel="stylesheet"
|
|
43
|
+
href="https://unpkg.com/@quartzds/generic-tokens-core/dist/platform/desktop.css"
|
|
44
|
+
/>
|
|
45
|
+
<link
|
|
46
|
+
rel="stylesheet"
|
|
47
|
+
href="https://unpkg.com/@quartzds/generic-tokens-core/dist/theme/light.css"
|
|
48
|
+
/>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Optionally, the dark theme:
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<link
|
|
55
|
+
rel="stylesheet"
|
|
56
|
+
href="https://unpkg.com/@quartzds/generic-tokens-core/dist/theme/dark.css"
|
|
57
|
+
/>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Finally, bootstrap the components with their styling:
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<script type="module">
|
|
64
|
+
import { defineCustomElements } from 'https://unpkg.com/@quartzds/core/loader'
|
|
65
|
+
import {
|
|
66
|
+
setPlatform,
|
|
67
|
+
setTheme,
|
|
68
|
+
} from 'https://unpkg.com/@quartzds/core/components'
|
|
69
|
+
|
|
70
|
+
setPlatform('desktop')
|
|
71
|
+
setTheme('light')
|
|
72
|
+
defineCustomElements()
|
|
73
|
+
</script>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Any Quartz component added to the webpage will automatically load with the
|
|
77
|
+
proper platform and theme-specific styling. This includes writing the
|
|
78
|
+
component tag directly in HTML or using JavaScript such as
|
|
79
|
+
`document.createElement('qds-button')`.
|
|
80
|
+
|
|
81
|
+
### Framework Bindings
|
|
82
|
+
|
|
83
|
+
The `@quartzds/core` package can be used in vanilla HTML or JavaScript
|
|
84
|
+
without any framework at all. Quartz also has packages that make it easier to
|
|
85
|
+
integrate into a framework's ecosystem and patterns:
|
|
86
|
+
|
|
87
|
+
- [`@quartzds/core-angular`][]
|
|
88
|
+
- [`@quartzds/core-react`][]
|
|
89
|
+
- [`@quartzds/core-vue`][]
|
|
90
|
+
|
|
91
|
+
### Custom Elements
|
|
92
|
+
|
|
93
|
+
Besides the lazy-loading components built by Stencil, this package also
|
|
94
|
+
exports each component as a stand-alone custom element from
|
|
95
|
+
`@quartzds/core`. Each component extends `HTMLElement` and does not
|
|
96
|
+
lazy-load itself. This is useful for projects already using a bundler such as
|
|
97
|
+
Webpack or Vite. While all components are available to be imported, the custom
|
|
98
|
+
element exports make sure bundlers only import what's used and tree-shake any
|
|
99
|
+
unused components.
|
|
100
|
+
|
|
101
|
+
Below is an example of importing the `qds-button` custom element:
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
import { defineCustomElementQdsButton } from '@quartzds/core'
|
|
105
|
+
|
|
106
|
+
defineCustomElementQdsButton()
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The `defineCustomElementQdsButton` function will automatically define the
|
|
110
|
+
component as well as any child component that may be required.
|
|
111
|
+
|
|
112
|
+
The `qds-button` custom element can also be imported and registered manually:
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
import { QdsButton } from '@quartzds/core'
|
|
116
|
+
|
|
117
|
+
customElements.define('qds-button', QdsButton)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## ⚖️ License
|
|
121
|
+
|
|
122
|
+
See the [LICENSE][] file for license rights and limitations.
|
|
123
|
+
|
|
124
|
+
- Some code borrowed from [Ionic][] is licensed under MIT.
|
|
125
|
+
- Some code borrowed from [Shoelace][] is licensed under MIT.
|
|
126
|
+
|
|
127
|
+
[npm-badge]: https://img.shields.io/npm/v/@quartzds/core?logo=npm
|
|
128
|
+
[npm-link]: https://www.npmjs.com/package/@quartzds/core
|
|
129
|
+
[license-badge]: https://img.shields.io/npm/l/@quartzds/core?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PHBhdGggZD0ibTIzLjkgOS43LTMuNTQtNy44OS0uMDA1LS4wMWEuNTQyLjU0MiAwIDAgMC0uMDQxLS4wNzZsLS4wMTQtLjAxOGEuNTMzLjUzMyAwIDAgMC0uMTIyLS4xMjJsLS4wMTUtLjAxMWEuNTI4LjUyOCAwIDAgMC0uMDgtLjA0NGwtLjAyNC0uMDA5YS41MjcuNTI3IDAgMCAwLS4wNjctLjAybC0uMDI4LS4wMDdhLjUyNC41MjQgMCAwIDAtLjA5Ni0uMDFoLTYuODVjLTEuMDItMS41Mi0xLjAyLTEuNTQtMiAwaC02Ljg2YS41NDMuNTQzIDAgMCAwLS4wOTYuMDFsLS4wMjguMDA3YS41MTYuNTE2IDAgMCAwLS4wNjcuMDJsLS4wMjQuMDFhLjUzNy41MzcgMCAwIDAtLjA4LjA0M2wtLjAxNS4wMTFhLjUxLjUxIDAgMCAwLS4wNTcuMDQ3bC0uMDIuMDJhLjU0My41NDMgMCAwIDAtLjA0NS4wNTVsLS4wMTQuMDE4YS41MjIuNTIyIDAgMCAwLS4wNDEuMDc1bC0uMDA1LjAxdi4wMDFMLjExNiA5LjcyYS41MzEuNTMxIDAgMCAwLS4wOTYuMzA0YzAgMi4yOCAxLjg2IDQuMTQgNC4xNCA0LjE0czQuMTQtMS44NiA0LjE0LTQuMTRhLjUzLjUzIDAgMCAwLS4wOTYtLjMwNGwtMy4yNS02LjM3IDYuMDctLjAyM3YxOC4yYy0yLjU1LjI5NC03LjAxLjM4MS03IDIuNWgxNmMwLTIuMDMtNC40OC0yLjI3LTctMi41di0xOC4xbDUuNjktLjAyLTIuOTIgNi40OWMwIC4wMDIgMCAuMDAzLS4wMDIuMDA1bC0uMDA2LjAxOGEuNTQ1LjU0NSAwIDAgMC0uMDIzLjA3NWwtLjAwNS4wMmEuNTI0LjUyNCAwIDAgMC0uMDEuMDkydi4wMDhjMCAyLjI4IDEuODYgNC4xNCA0LjE0IDQuMTQgMi4yOCAwIDQuMTQtMS44NiA0LjE0LTQuMTRhLjUyOC41MjggMCAwIDAtLjEyLS4zMzJ6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+
|
|
130
|
+
[license]: ../../LICENSE
|
|
131
|
+
[quartz design system]: https://github.com/quartzds
|
|
132
|
+
[`@quartzds/core-angular`]: https://www.npmjs.com/package/@quartzds/core-angular
|
|
133
|
+
[`@quartzds/core-react`]: https://www.npmjs.com/package/@quartzds/core-react
|
|
134
|
+
[`@quartzds/core-vue`]: https://www.npmjs.com/package/@quartzds/core-vue
|
|
135
|
+
[ionic]: https://github.com/ionic-team/ionic-framework
|
|
136
|
+
[shoelace]: https://github.com/shoelace-style/shoelace
|