@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.
Files changed (160) hide show
  1. package/README.md +136 -0
  2. package/components/floating-ui.dom.esm.js +1402 -0
  3. package/components/floating-ui.dom.esm.js.map +1 -0
  4. package/components/helpers.js +174 -0
  5. package/components/helpers.js.map +1 -0
  6. package/components/icon.js +175 -0
  7. package/components/icon.js.map +1 -0
  8. package/components/index.d.ts +52 -0
  9. package/components/index.js +117 -0
  10. package/components/index.js.map +1 -0
  11. package/components/label.js +55 -0
  12. package/components/label.js.map +1 -0
  13. package/components/qds-button.d.ts +11 -0
  14. package/components/qds-button.js +148 -0
  15. package/components/qds-button.js.map +1 -0
  16. package/components/qds-checkbox.d.ts +11 -0
  17. package/components/qds-checkbox.js +156 -0
  18. package/components/qds-checkbox.js.map +1 -0
  19. package/components/qds-dropdown.d.ts +11 -0
  20. package/components/qds-dropdown.js +259 -0
  21. package/components/qds-dropdown.js.map +1 -0
  22. package/components/qds-icon.d.ts +11 -0
  23. package/components/qds-icon.js +13 -0
  24. package/components/qds-icon.js.map +1 -0
  25. package/components/qds-inline-link.d.ts +11 -0
  26. package/components/qds-inline-link.js +89 -0
  27. package/components/qds-inline-link.js.map +1 -0
  28. package/components/qds-input.d.ts +11 -0
  29. package/components/qds-input.js +244 -0
  30. package/components/qds-input.js.map +1 -0
  31. package/components/qds-label.d.ts +11 -0
  32. package/components/qds-label.js +13 -0
  33. package/components/qds-label.js.map +1 -0
  34. package/components/qds-radio.d.ts +11 -0
  35. package/components/qds-radio.js +109 -0
  36. package/components/qds-radio.js.map +1 -0
  37. package/components/qds-switch.d.ts +11 -0
  38. package/components/qds-switch.js +119 -0
  39. package/components/qds-switch.js.map +1 -0
  40. package/components/qds-title.d.ts +11 -0
  41. package/components/qds-title.js +94 -0
  42. package/components/qds-title.js.map +1 -0
  43. package/components/qds-tooltip.d.ts +11 -0
  44. package/components/qds-tooltip.js +325 -0
  45. package/components/qds-tooltip.js.map +1 -0
  46. package/dist/cjs/floating-ui.dom.esm-71fa96af.js +1410 -0
  47. package/dist/cjs/floating-ui.dom.esm-71fa96af.js.map +1 -0
  48. package/dist/cjs/helpers-0b23af3f.js +184 -0
  49. package/dist/cjs/helpers-0b23af3f.js.map +1 -0
  50. package/dist/cjs/index-f19b2823.js +2030 -0
  51. package/dist/cjs/index-f19b2823.js.map +1 -0
  52. package/dist/cjs/index.cjs.js +115 -0
  53. package/dist/cjs/index.cjs.js.map +1 -0
  54. package/dist/cjs/library-4803c801.js +62 -0
  55. package/dist/cjs/library-4803c801.js.map +1 -0
  56. package/dist/cjs/loader.cjs.js +29 -0
  57. package/dist/cjs/loader.cjs.js.map +1 -0
  58. package/dist/cjs/qds-button.cjs.entry.js +110 -0
  59. package/dist/cjs/qds-button.cjs.entry.js.map +1 -0
  60. package/dist/cjs/qds-checkbox.cjs.entry.js +116 -0
  61. package/dist/cjs/qds-checkbox.cjs.entry.js.map +1 -0
  62. package/dist/cjs/qds-dropdown.cjs.entry.js +227 -0
  63. package/dist/cjs/qds-dropdown.cjs.entry.js.map +1 -0
  64. package/dist/cjs/qds-icon.cjs.entry.js +113 -0
  65. package/dist/cjs/qds-icon.cjs.entry.js.map +1 -0
  66. package/dist/cjs/qds-inline-link.cjs.entry.js +61 -0
  67. package/dist/cjs/qds-inline-link.cjs.entry.js.map +1 -0
  68. package/dist/cjs/qds-input.cjs.entry.js +200 -0
  69. package/dist/cjs/qds-input.cjs.entry.js.map +1 -0
  70. package/dist/cjs/qds-label.cjs.entry.js +39 -0
  71. package/dist/cjs/qds-label.cjs.entry.js.map +1 -0
  72. package/dist/cjs/qds-radio.cjs.entry.js +74 -0
  73. package/dist/cjs/qds-radio.cjs.entry.js.map +1 -0
  74. package/dist/cjs/qds-switch.cjs.entry.js +79 -0
  75. package/dist/cjs/qds-switch.cjs.entry.js.map +1 -0
  76. package/dist/cjs/qds-title.cjs.entry.js +66 -0
  77. package/dist/cjs/qds-title.cjs.entry.js.map +1 -0
  78. package/dist/cjs/qds-tooltip.cjs.entry.js +284 -0
  79. package/dist/cjs/qds-tooltip.cjs.entry.js.map +1 -0
  80. package/dist/cjs/qds.cjs.js +33 -0
  81. package/dist/cjs/qds.cjs.js.map +1 -0
  82. package/dist/custom-elements.json +3976 -0
  83. package/dist/docs.d.ts +148 -0
  84. package/dist/docs.json +3918 -0
  85. package/dist/esm/floating-ui.dom.esm-f96ac766.js +1402 -0
  86. package/dist/esm/floating-ui.dom.esm-f96ac766.js.map +1 -0
  87. package/dist/esm/helpers-5c189a19.js +174 -0
  88. package/dist/esm/helpers-5c189a19.js.map +1 -0
  89. package/dist/esm/index-1bc8e218.js +2000 -0
  90. package/dist/esm/index-1bc8e218.js.map +1 -0
  91. package/dist/esm/index.js +106 -0
  92. package/dist/esm/index.js.map +1 -0
  93. package/dist/esm/library-aa6893c0.js +58 -0
  94. package/dist/esm/library-aa6893c0.js.map +1 -0
  95. package/dist/esm/loader.js +25 -0
  96. package/dist/esm/loader.js.map +1 -0
  97. package/dist/esm/polyfills/core-js.js +11 -0
  98. package/dist/esm/polyfills/css-shim.js +1 -0
  99. package/dist/esm/polyfills/dom.js +79 -0
  100. package/dist/esm/polyfills/es5-html-element.js +1 -0
  101. package/dist/esm/polyfills/index.js +34 -0
  102. package/dist/esm/polyfills/system.js +6 -0
  103. package/dist/esm/qds-button.entry.js +106 -0
  104. package/dist/esm/qds-button.entry.js.map +1 -0
  105. package/dist/esm/qds-checkbox.entry.js +112 -0
  106. package/dist/esm/qds-checkbox.entry.js.map +1 -0
  107. package/dist/esm/qds-dropdown.entry.js +223 -0
  108. package/dist/esm/qds-dropdown.entry.js.map +1 -0
  109. package/dist/esm/qds-icon.entry.js +109 -0
  110. package/dist/esm/qds-icon.entry.js.map +1 -0
  111. package/dist/esm/qds-inline-link.entry.js +57 -0
  112. package/dist/esm/qds-inline-link.entry.js.map +1 -0
  113. package/dist/esm/qds-input.entry.js +196 -0
  114. package/dist/esm/qds-input.entry.js.map +1 -0
  115. package/dist/esm/qds-label.entry.js +35 -0
  116. package/dist/esm/qds-label.entry.js.map +1 -0
  117. package/dist/esm/qds-radio.entry.js +70 -0
  118. package/dist/esm/qds-radio.entry.js.map +1 -0
  119. package/dist/esm/qds-switch.entry.js +75 -0
  120. package/dist/esm/qds-switch.entry.js.map +1 -0
  121. package/dist/esm/qds-title.entry.js +62 -0
  122. package/dist/esm/qds-title.entry.js.map +1 -0
  123. package/dist/esm/qds-tooltip.entry.js +280 -0
  124. package/dist/esm/qds-tooltip.entry.js.map +1 -0
  125. package/dist/esm/qds.js +28 -0
  126. package/dist/esm/qds.js.map +1 -0
  127. package/dist/types/components/button/button.d.ts +209 -0
  128. package/dist/types/components/checkbox/checkbox.d.ts +136 -0
  129. package/dist/types/components/create-story.d.ts +5 -0
  130. package/dist/types/components/dropdown/dropdown.d.ts +135 -0
  131. package/dist/types/components/icon/default-library.d.ts +4 -0
  132. package/dist/types/components/icon/icon.d.ts +31 -0
  133. package/dist/types/components/icon/library.d.ts +19 -0
  134. package/dist/types/components/icon/request.d.ts +12 -0
  135. package/dist/types/components/icon/system-library.d.ts +4 -0
  136. package/dist/types/components/inline-link/inline-link.d.ts +208 -0
  137. package/dist/types/components/input/input.d.ts +386 -0
  138. package/dist/types/components/label/label.d.ts +33 -0
  139. package/dist/types/components/radio/radio.d.ts +110 -0
  140. package/dist/types/components/switch/switch.d.ts +115 -0
  141. package/dist/types/components/title/title.d.ts +42 -0
  142. package/dist/types/components/tooltip/tooltip.d.ts +147 -0
  143. package/dist/types/components.d.ts +1692 -0
  144. package/dist/types/helpers.d.ts +49 -0
  145. package/dist/types/index.d.ts +4 -0
  146. package/dist/types/qds-test.d.ts +18 -0
  147. package/dist/types/stencil-public-runtime.d.ts +1638 -0
  148. package/dist/types/utils.d.ts +65 -0
  149. package/dist/vscode.html-custom-data.json +947 -0
  150. package/hydrate/index.d.ts +218 -0
  151. package/hydrate/index.js +9690 -0
  152. package/hydrate/package.json +6 -0
  153. package/loader/cdn.js +7 -0
  154. package/loader/index.cjs.js +7 -0
  155. package/loader/index.d.ts +21 -0
  156. package/loader/index.es2017.js +7 -0
  157. package/loader/index.js +8 -0
  158. package/loader/package.json +11 -0
  159. package/package.json +231 -0
  160. 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.npm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GEuNTQ1LjU0NSAwIDAgMC0uMDIzLjA3NWwtLjAwNS4wMmEuNTI0LjUyNCAwIDAgMC0uMDEuMDkydi4wMDhjMCAyLjI4IDEuODYgNC4xNCA0LjE0IDQuMTQgMi4yOCAwIDQuMTQtMS44NiA0LjE0LTQuMTRhLjUyOC41MjggMCAwIDAtLjEyLS4zMzJ6IiBmaWxsPSIjZmZmIj48L3BhdGg+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