@d0rich/esprit-design 0.4.4 → 1.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +157 -11
  3. package/dist/_virtual/_plugin-vue_export-helper.js +10 -0
  4. package/dist/components/DChip.vue.js +14 -0
  5. package/dist/components/DChip.vue2.js +6 -0
  6. package/dist/components/DPagination.vue.js +116 -0
  7. package/dist/components/DPagination.vue2.js +4 -0
  8. package/dist/components/DStats.vue.js +367 -0
  9. package/dist/components/DStats.vue4.js +6 -0
  10. package/dist/components/animations/DAnimationAccordion.vue.js +47 -0
  11. package/dist/components/animations/DAnimationAccordion.vue3.js +5 -0
  12. package/dist/components/animations/DAnimationDefLetterD.vue.js +11 -0
  13. package/dist/components/animations/DAnimationDefLetterD.vue2.js +6 -0
  14. package/dist/components/animations/DAnimationFloatingLetter.vue.js +39 -0
  15. package/dist/components/animations/DAnimationFloatingLetter.vue3.js +5 -0
  16. package/dist/components/animations/DAnimationHypnosis.vue.js +46 -0
  17. package/dist/components/animations/DAnimationHypnosis.vue3.js +5 -0
  18. package/dist/components/animations/DAnimationSpinner.vue.js +80 -0
  19. package/dist/components/animations/DAnimationSpinner.vue3.js +5 -0
  20. package/dist/components/buttons/DBigBangButton.vue.js +56 -0
  21. package/dist/components/buttons/DBigBangButton.vue3.js +5 -0
  22. package/dist/components/buttons/DBigBangButtonAnimation.vue.js +97 -0
  23. package/dist/components/buttons/DBigBangButtonAnimation.vue3.js +5 -0
  24. package/dist/components/buttons/DBtn.vue.js +92 -0
  25. package/dist/components/buttons/DBtn.vue3.js +5 -0
  26. package/dist/components/cards/DCard.vue.js +50 -0
  27. package/dist/components/cards/DCard.vue3.js +5 -0
  28. package/dist/components/cards/DCardTitle.vue.js +30 -0
  29. package/dist/components/cards/DCardTitle.vue2.js +12 -0
  30. package/dist/components/content/DAlert.vue.js +61 -0
  31. package/dist/components/content/DAlert.vue3.js +5 -0
  32. package/dist/components/content/DQuote.vue.js +39 -0
  33. package/dist/components/content/DQuote.vue3.js +5 -0
  34. package/dist/components/index.js +61 -0
  35. package/dist/components/lists/DActionsFan.vue.js +101 -0
  36. package/dist/components/lists/DActionsFan.vue4.js +6 -0
  37. package/dist/components/lists/DActionsList.vue.js +89 -0
  38. package/dist/components/lists/DActionsList.vue3.js +5 -0
  39. package/dist/components/utils/DWrapBackground.vue.js +86 -0
  40. package/dist/components/utils/DWrapBackground.vue3.js +5 -0
  41. package/dist/components/utils/DWrapFocusHighlight.vue.js +93 -0
  42. package/dist/components/utils/DWrapFocusHighlight.vue5.js +7 -0
  43. package/dist/components/utils/DWrapShape.vue.js +73 -0
  44. package/dist/components/utils/DWrapShape.vue4.js +6 -0
  45. package/dist/composables/big-bang-button-utils.js +8 -0
  46. package/dist/composables/index.js +6 -0
  47. package/dist/composables/router.js +71 -0
  48. package/dist/composables/utils.js +7 -0
  49. package/dist/index.js +78 -0
  50. package/dist/style.css +869 -0
  51. package/dist/style.pure.css +2026 -0
  52. package/dist/style.tailwind.css +869 -0
  53. package/dist/utils/boundings.js +33 -0
  54. package/dist/utils/index.js +15 -0
  55. package/dist/utils/pagination.js +7 -0
  56. package/dist/utils/polygon-animation.js +85 -0
  57. package/package.json +32 -5
  58. package/src/components/animations/DAnimationAccordion.vue +6 -0
  59. package/src/components/animations/DAnimationFloatingLetter.vue +6 -0
  60. package/src/components/animations/DAnimationHypnosis.vue +6 -0
  61. package/src/components/animations/DAnimationSpinner.vue +6 -0
  62. package/src/components/buttons/DBigBangButton.vue +1 -1
  63. package/src/components/buttons/DBigBangButtonAnimation.vue +10 -0
  64. package/src/components/utils/DWrapFocusHighlight.vue +25 -0
  65. package/tailwind.config.js +14 -3
  66. package/vite.config.ts +74 -10
  67. package/dist/esprit-design.css +0 -1
  68. package/dist/esprit-design.js +0 -2586
  69. package/dist/esprit-design.umd.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @d0rich/esprit-design
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 109c135: Proper compilation
8
+
9
+ ## 0.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 44d2094: Add fallback fonts for dialog fonts
14
+ - 44d2094: Handle prefers reduced motion
15
+
3
16
  ## 0.4.4
4
17
 
5
18
  ### Patch Changes
package/README.md CHANGED
@@ -1,18 +1,164 @@
1
- # Vue 3 + TypeScript + Vite
1
+ # @d0rich/esprit-design
2
2
 
3
- This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
3
+ Vue 3 UI component library featuring expressive polygon geometry, interactive animations, and responsive dark mode support.
4
4
 
5
- ## Recommended IDE Setup
5
+ ## Installation
6
6
 
7
- - [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
7
+ Install the package via your preferred package manager:
8
8
 
9
- ## Type Support For `.vue` Imports in TS
9
+ ```bash
10
+ # npm
11
+ npm install @d0rich/esprit-design
10
12
 
11
- TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
13
+ # pnpm
14
+ pnpm add @d0rich/esprit-design
12
15
 
13
- If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
16
+ # yarn
17
+ yarn add @d0rich/esprit-design
18
+ ```
14
19
 
15
- 1. Disable the built-in TypeScript Extension
16
- 1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
17
- 2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
18
- 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
20
+ ### Peer / Runtime Dependencies
21
+
22
+ Make sure the following peer/runtime dependencies are installed in your project:
23
+
24
+ - `vue` (^3.3.0)
25
+ - `gsap` (^3.12.0)
26
+ - `@vueuse/core` (^10.0.0 or ^13.0.0)
27
+ - `@iconify/vue` (^4.0.0)
28
+
29
+ ---
30
+
31
+ ## Styling Options
32
+
33
+ `@d0rich/esprit-design` provides two compiled CSS files depending on whether your project uses Tailwind CSS:
34
+
35
+ ### 1. Pure CSS (No Tailwind Required)
36
+
37
+ If your project does **not** use Tailwind CSS, import the standalone pure CSS stylesheet. It includes all pre-compiled utility classes, resets, and component styles with zero runtime or build-time Tailwind dependencies:
38
+
39
+ ```typescript
40
+ // main.ts / main.js / App.vue
41
+ import '@d0rich/esprit-design/style.pure.css'
42
+ ```
43
+
44
+ ### 2. Tailwind-Based CSS (For Tailwind Projects)
45
+
46
+ If your project already uses Tailwind CSS, import the Tailwind-based stylesheet:
47
+
48
+ ```typescript
49
+ // main.ts / main.js
50
+ import '@d0rich/esprit-design/style.tailwind.css'
51
+ // or using the fallback alias:
52
+ // import '@d0rich/esprit-design/style.css'
53
+ ```
54
+
55
+ Then extend your project's `tailwind.config.js` with the preset:
56
+
57
+ ```javascript
58
+ // tailwind.config.js
59
+ module.exports = {
60
+ presets: [require('@d0rich/esprit-design/tailwind.config')],
61
+ content: [
62
+ // your project files...
63
+ './node_modules/@d0rich/esprit-design/dist/**/*.{js,vue}'
64
+ ]
65
+ }
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Usage & Code Splitting
71
+
72
+ You can import components and utilities from the root package or via specific subpath exports:
73
+
74
+ ### Root Import
75
+
76
+ ```typescript
77
+ import { DBtn, DCard, DAlert, useDPaginationUtils } from '@d0rich/esprit-design'
78
+ ```
79
+
80
+ ### Subpath Imports
81
+
82
+ ```typescript
83
+ // Components only
84
+ import { DBtn, DCard, DAlert } from '@d0rich/esprit-design/components'
85
+
86
+ // Composables only
87
+ import { useDPaginationUtils, useDBigBangButtonUtils } from '@d0rich/esprit-design/composables'
88
+
89
+ // Utilities only
90
+ import { getAbsoluteBoundings, getLinkToPaginatedPage } from '@d0rich/esprit-design/utils'
91
+ ```
92
+
93
+ ### Direct Component Import
94
+
95
+ For maximum tree-shaking efficiency:
96
+
97
+ ```typescript
98
+ import DBtn from '@d0rich/esprit-design/components/buttons/DBtn.vue'
99
+ import DCard from '@d0rich/esprit-design/components/cards/DCard.vue'
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Components
105
+
106
+ ### General Components
107
+
108
+ - **`DChip`**: A polygon-clipped badge / chip component with print-friendly styles.
109
+ - **`DPagination`**: Accessible pagination navigation with numbered page links, jump ellipsis, and next/prev controls.
110
+ - **`DStats`**: Interactive polygonal radar/star skill matrix visualization with animated SVG layers and print layout fallbacks.
111
+
112
+ ### Buttons (`@d0rich/esprit-design/components`)
113
+
114
+ - **`DBtn`**: Core button component supporting Vue Router links, NuxtLink, external links, rotated accent styling (`rotated`), and casing transforms (`uppercase`, `capitalize`, `lowercase`).
115
+ - **`DBigBangButton`**: Stylized display button with animated letter-scatter and hover effects.
116
+ - **`DBigBangButtonAnimation`**: Fullscreen typography animation layer triggered in coordination with `DBigBangButton`.
117
+
118
+ ### Cards (`@d0rich/esprit-design/components`)
119
+
120
+ - **`DCard`**: Angled polygon container with dark/light mode background handling and responsive padding variants (`dense` or standard).
121
+ - **`DCardTitle`**: Clipped header badge designed to overlay the corner of `DCard`.
122
+
123
+ ### Content (`@d0rich/esprit-design/components`)
124
+
125
+ - **`DAlert`**: Clipped callout container supporting `info`, `question`, and `warning` variants with themed drop-shadow icons.
126
+ - **`DQuote`**: Asymmetric speech-bubble blockquote supporting `left` and `right` orientation.
127
+
128
+ ### Lists (`@d0rich/esprit-design/components`)
129
+
130
+ - **`DActionsList`**: Tilted menu container with frosted-glass backdrop blur and action item slots.
131
+ - **`DActionsFan`**: Expanding fan-out list with animated entrance/exit transitions and directional alignment (`left` or `right`).
132
+
133
+ ### Animations (`@d0rich/esprit-design/components`)
134
+
135
+ - **`DAnimationAccordion`**: Multi-layered SVG chevron animation with oscillating delay.
136
+ - **`DAnimationDefLetterD`**: Decorative stylized 'D' letter SVG artwork.
137
+ - **`DAnimationFloatingLetter`**: Floating oscillating letter SVG animation with reduced-motion support.
138
+ - **`DAnimationHypnosis`**: Hypnotic concentric polygon scaling animation.
139
+ - **`DAnimationSpinner`**: Rotating geometric multi-blade loading spinner.
140
+
141
+ ### Wrappers (`@d0rich/esprit-design/components`)
142
+
143
+ - **`DWrapShape`**: Utility wrapper applying custom polygon clip-path outlines and background filters.
144
+ - **`DWrapFocusHighlight`**: Interactive wrapper adding negative-tile or list-item hover and active focus highlight effects.
145
+ - **`DWrapBackground`**: Layered background wrapper rendering SVG dot patterns.
146
+
147
+ ---
148
+
149
+ ## Composables (`@d0rich/esprit-design/composables`)
150
+
151
+ - **`useDPaginationUtils()`**: Helpers for constructing paginated URLs (`getLinkToPaginatedPage(baseLink, pageNumber)`).
152
+ - **`useDBigBangButtonUtils()`**: Shared reactive state for triggering fullscreen Big Bang button overlay animations.
153
+
154
+ ---
155
+
156
+ ## Utilities (`@d0rich/esprit-design/utils`)
157
+
158
+ - **`boundings`**:
159
+ - `getAbsoluteBoundings(element)`: Computes element coordinates and dimensions relative to the document.
160
+ - `getAbsoluteBoundingsGetters(element)`: Returns reactive getters for element bounding coordinates.
161
+ - **`pagination`**:
162
+ - `getLinkToPaginatedPage(baseLink, pageNumber)`: Formats pagination links with query/hash preservation.
163
+ - **`polygon-animation`**:
164
+ - Vector and polygon manipulation functions for GSAP SVG morphing and timeline animations (`applyLinePerPointAnimation`, `createCoordsFromArray`, `createLineEdgeFromArray`, `generatePolygonPointsKeyframes`, `generatePolygonLineKeyframes`, etc.).
@@ -0,0 +1,10 @@
1
+ const _export_sfc = (sfc, props) => {
2
+ const target = sfc.__vccOpts || sfc;
3
+ for (const [key, val] of props) {
4
+ target[key] = val;
5
+ }
6
+ return target;
7
+ };
8
+ export {
9
+ _export_sfc as default
10
+ };
@@ -0,0 +1,14 @@
1
+ import _sfc_main from "./DChip.vue2.js";
2
+ import { createElementBlock, openBlock, renderSlot } from "vue";
3
+ /* empty css */
4
+ import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
5
+ const _hoisted_1 = { class: "d-chip" };
6
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
7
+ return openBlock(), createElementBlock("span", _hoisted_1, [
8
+ renderSlot(_ctx.$slots, "default")
9
+ ]);
10
+ }
11
+ const DChip = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
12
+ export {
13
+ DChip as default
14
+ };
@@ -0,0 +1,6 @@
1
+ const _sfc_main = {
2
+ name: "DChip"
3
+ };
4
+ export {
5
+ _sfc_main as default
6
+ };
@@ -0,0 +1,116 @@
1
+ import { defineComponent, computed, createElementBlock, openBlock, createBlock, createCommentVNode, withCtx, createVNode, unref, createTextVNode, Fragment, renderList, toDisplayString } from "vue";
2
+ import { Icon } from "@iconify/vue";
3
+ import { useDPaginationUtils } from "../composables/utils.js";
4
+ import _sfc_main$1 from "./buttons/DBtn.vue.js";
5
+ /* empty css */
6
+ const _hoisted_1 = { class: "w-fit text-2xl font-bold" };
7
+ const _hoisted_2 = {
8
+ key: 2,
9
+ class: "mx-1"
10
+ };
11
+ const _hoisted_3 = {
12
+ key: 3,
13
+ class: "mx-1"
14
+ };
15
+ const __default__ = {
16
+ name: "DPagination",
17
+ components: {
18
+ DBtn: _sfc_main$1,
19
+ Icon
20
+ }
21
+ };
22
+ const _sfc_main = /* @__PURE__ */ defineComponent({
23
+ ...__default__,
24
+ props: {
25
+ currentPage: {
26
+ type: Number,
27
+ default: 1
28
+ },
29
+ allPages: {
30
+ type: Number,
31
+ required: true
32
+ },
33
+ baseLink: {
34
+ type: String,
35
+ required: true
36
+ }
37
+ },
38
+ setup(__props) {
39
+ const props = __props;
40
+ const { getLinkToPaginatedPage } = useDPaginationUtils();
41
+ function getLinkToPage(page) {
42
+ return getLinkToPaginatedPage(props.baseLink, page);
43
+ }
44
+ const visiblePages = computed(() => {
45
+ return Array.from({ length: 7 }, (_, i) => i - 3 + props.currentPage).filter(
46
+ (num) => num >= 1 && num <= props.allPages
47
+ );
48
+ });
49
+ return (_ctx, _cache) => {
50
+ return openBlock(), createElementBlock("nav", _hoisted_1, [
51
+ __props.currentPage > 1 ? (openBlock(), createBlock(_sfc_main$1, {
52
+ key: 0,
53
+ class: "inline-block mx-1",
54
+ to: getLinkToPage(__props.currentPage - 1),
55
+ "aria-label": "Previous page"
56
+ }, {
57
+ default: withCtx(() => [
58
+ createVNode(unref(Icon), { icon: "ic:baseline-arrow-back-ios" })
59
+ ]),
60
+ _: 1
61
+ }, 8, ["to"])) : createCommentVNode("", true),
62
+ !visiblePages.value.includes(1) ? (openBlock(), createBlock(_sfc_main$1, {
63
+ key: 1,
64
+ class: "inline-block mx-1",
65
+ to: getLinkToPage(1),
66
+ "aria-label": "First page"
67
+ }, {
68
+ default: withCtx(() => _cache[0] || (_cache[0] = [
69
+ createTextVNode(" 1 ")
70
+ ])),
71
+ _: 1
72
+ }, 8, ["to"])) : createCommentVNode("", true),
73
+ !visiblePages.value.includes(1) ? (openBlock(), createElementBlock("span", _hoisted_2, " ... ")) : createCommentVNode("", true),
74
+ (openBlock(true), createElementBlock(Fragment, null, renderList(visiblePages.value, (number) => {
75
+ return openBlock(), createBlock(_sfc_main$1, {
76
+ key: number,
77
+ class: "inline-block mx-1",
78
+ to: getLinkToPage(number),
79
+ "aria-label": `Page ${number}`
80
+ }, {
81
+ default: withCtx(() => [
82
+ createTextVNode(toDisplayString(number), 1)
83
+ ]),
84
+ _: 2
85
+ }, 1032, ["to", "aria-label"]);
86
+ }), 128)),
87
+ !visiblePages.value.includes(__props.allPages) ? (openBlock(), createElementBlock("span", _hoisted_3, " ... ")) : createCommentVNode("", true),
88
+ !visiblePages.value.includes(__props.allPages) ? (openBlock(), createBlock(_sfc_main$1, {
89
+ key: 4,
90
+ class: "inline-block mx-1",
91
+ to: getLinkToPage(__props.allPages),
92
+ "aria-label": `Last page (${__props.allPages})`
93
+ }, {
94
+ default: withCtx(() => [
95
+ createTextVNode(toDisplayString(__props.allPages), 1)
96
+ ]),
97
+ _: 1
98
+ }, 8, ["to", "aria-label"])) : createCommentVNode("", true),
99
+ __props.currentPage < __props.allPages ? (openBlock(), createBlock(_sfc_main$1, {
100
+ key: 5,
101
+ class: "inline-block mx-1",
102
+ to: getLinkToPage(__props.currentPage + 1),
103
+ "aria-label": "Next page"
104
+ }, {
105
+ default: withCtx(() => [
106
+ createVNode(unref(Icon), { icon: "ic:baseline-arrow-forward-ios" })
107
+ ]),
108
+ _: 1
109
+ }, 8, ["to"])) : createCommentVNode("", true)
110
+ ]);
111
+ };
112
+ }
113
+ });
114
+ export {
115
+ _sfc_main as default
116
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./DPagination.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };