@newlogic-digital/ui 3.7.5 → 4.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/README.md +17 -31
- package/package.json +21 -12
- package/src/data/main.json +2 -32
- package/src/data/nav.json +12 -0
- package/src/icons.svg +0 -30
- package/src/pages/dialog/basic.json.latte +5 -0
- package/src/pages/email/index.json +12 -0
- package/src/pages/gdpr.json +11 -0
- package/src/pages/index.json +8 -0
- package/src/scripts/components/(ui)/+.js +12 -0
- package/src/scripts/components/(ui)/Button.js +4 -0
- package/src/scripts/components/(ui)/Compare.js +4 -0
- package/src/scripts/components/(ui)/Control.js +11 -0
- package/src/scripts/components/(ui)/ControlSelect.js +4 -0
- package/src/scripts/components/(ui)/Details.js +4 -0
- package/src/scripts/components/(ui)/Dialog.js +17 -0
- package/src/scripts/components/(ui)/Drawer.js +4 -0
- package/src/scripts/components/(ui)/Form.js +15 -0
- package/src/scripts/components/(ui)/Popover.js +4 -0
- package/src/scripts/components/(ui)/Range.js +4 -0
- package/src/scripts/components/(ui)/Tabs.js +4 -0
- package/src/scripts/components/(ui)/Toast.js +4 -0
- package/src/scripts/components/+.js +5 -0
- package/src/scripts/components/App.js +5 -0
- package/src/scripts/components/ReCaptcha.js +4 -0
- package/src/scripts/components/Reveal.js +4 -0
- package/src/scripts/components/cookieconsent/+.js +2 -0
- package/src/scripts/components/cookieconsent/CookieConsentDialog.js +4 -0
- package/src/scripts/components/cookieconsent/CookieConsentForm.js +4 -0
- package/src/scripts/composables/+.js +3 -0
- package/src/scripts/composables/naja.js +24 -0
- package/src/scripts/composables/stimulus.js +31 -0
- package/src/scripts/composables/swup.js +23 -0
- package/src/scripts/main.js +3 -6
- package/src/scripts/utils/+.js +1 -0
- package/src/scripts/{Utils → utils}/initAfter.js +3 -3
- package/src/styles/base/+.css +4 -0
- package/src/styles/{Utils/default.css → base/defaults.css} +11 -1
- package/src/styles/base/transitions.css +12 -0
- package/src/styles/components/(layout)/+.css +2 -0
- package/src/styles/components/(layout)/Header.css +11 -0
- package/src/styles/{Layout → components/(layout)}/Main.css +2 -13
- package/src/styles/components/(ui)/+.css +23 -0
- package/src/styles/components/(ui)/Badge.css +8 -0
- package/src/styles/components/(ui)/Button.css +12 -0
- package/src/styles/components/(ui)/Check.css +1 -0
- package/src/styles/components/(ui)/Compare.css +1 -0
- package/src/styles/components/(ui)/Control.css +29 -0
- package/src/styles/components/(ui)/ControlSelect.css +1 -0
- package/src/styles/components/(ui)/Drawer.css +14 -0
- package/src/styles/components/(ui)/Group.css +1 -0
- package/src/styles/components/(ui)/Heading.css +4 -0
- package/src/styles/components/(ui)/Image.css +1 -0
- package/src/styles/components/(ui)/Info.css +1 -0
- package/src/styles/components/(ui)/Label.css +1 -0
- package/src/styles/components/(ui)/Link.css +2 -0
- package/src/styles/components/(ui)/Notice.css +1 -0
- package/src/styles/components/(ui)/Progress.css +1 -0
- package/src/styles/components/(ui)/Range.css +1 -0
- package/src/styles/components/(ui)/Switch.css +1 -0
- package/src/styles/components/(ui)/Text.css +1 -0
- package/src/styles/components/(ui)/Title.css +4 -0
- package/src/styles/components/(ui)/dialog/+.css +2 -0
- package/src/styles/components/(ui)/dialog/Dialog.css +2 -0
- package/src/styles/components/(ui)/dialog/DialogContent.css +2 -0
- package/src/styles/components/+.css +3 -0
- package/src/styles/components/cookieconsent/+.css +1 -0
- package/src/styles/{Components/Dialog/CookieConsent.css → components/cookieconsent/CookieConsentDialog.css} +4 -4
- package/src/styles/emails/+.css +5 -0
- package/src/styles/emails/base/+.css +2 -0
- package/src/styles/emails/base/defaults.css +22 -0
- package/src/styles/emails/components/+.css +4 -0
- package/src/styles/emails/components/Button.css +31 -0
- package/src/styles/emails/components/Heading.css +7 -0
- package/src/styles/emails/components/Main.css +13 -0
- package/src/{emails/styles/main/Ui → styles/emails/components}/Text.css +7 -5
- package/src/styles/emails/main.css +9 -0
- package/src/styles/emails/theme/+.css +2 -0
- package/src/styles/emails/theme/config.css +5 -0
- package/src/styles/emails/theme/default.css +13 -0
- package/src/styles/emails/utils/+.css +1 -0
- package/src/styles/emails/utils/common.css +29 -0
- package/src/styles/main.css +5 -11
- package/src/styles/theme/+.css +2 -0
- package/src/styles/theme/dark.css +5 -0
- package/src/styles/theme/main.css +35 -0
- package/src/styles/tinymce.css +2 -34
- package/src/styles/utils/+.css +4 -0
- package/src/styles/utils/container.css +5 -0
- package/src/styles/utils/index.css +8 -0
- package/src/styles/utils/reveal.css +22 -0
- package/src/styles/utils/scrollbar.css +23 -0
- package/src/templates/components/(layout)/Footer.latte +1 -0
- package/src/templates/components/(layout)/Header.latte +7 -0
- package/src/templates/components/(ui)/Toast.latte +9 -0
- package/src/templates/{Sections/Text.latte → components/Content.latte} +3 -3
- package/src/templates/components/Example.latte +17 -0
- package/src/templates/{Sections/CookieConsent.latte → components/cookieconsent/CookieConsentContent.latte} +4 -4
- package/src/templates/components/cookieconsent/CookieConsentDialog.latte +27 -0
- package/src/templates/{Components/Form/CookieConsent.latte → components/cookieconsent/CookieConsentForm.latte} +9 -9
- package/src/templates/components/dialog/DialogBasic.latte +18 -0
- package/src/templates/emails/components/Content.latte +29 -0
- package/src/templates/emails/components/Footer.latte +13 -0
- package/src/templates/emails/components/Header.latte +8 -0
- package/src/{emails/templates.test/Layout.latte → templates/emails/layouts/default.latte} +12 -12
- package/src/templates/{Layout/Main.latte → layouts/default.latte} +24 -26
- package/vite.config.js +2 -21
- package/src/emails/styles/main/+.css +0 -3
- package/src/emails/styles/main/Base/+.css +0 -2
- package/src/emails/styles/main/Base/config.css +0 -22
- package/src/emails/styles/main/Components/+.css +0 -1
- package/src/emails/styles/main/Components/Card.css +0 -12
- package/src/emails/styles/main/Ui/+.css +0 -3
- package/src/emails/styles/main/Ui/Btn.css +0 -78
- package/src/emails/styles/main/Ui/Heading.css +0 -8
- package/src/emails/styles/main.css +0 -92
- package/src/emails/templates/.gitkeep +0 -0
- package/src/emails/templates.test/Sections/Footer.latte +0 -22
- package/src/emails/templates.test/Sections/Header.latte +0 -37
- package/src/emails/templates.test/Sections/Text.latte +0 -24
- package/src/scripts/Components/+.js +0 -2
- package/src/scripts/Components/Drawer.js +0 -60
- package/src/scripts/Components/Popover.js +0 -65
- package/src/scripts/Layout/+.js +0 -1
- package/src/scripts/Layout/Header.js +0 -20
- package/src/scripts/Libraries/+.js +0 -10
- package/src/scripts/Libraries/CookieConsent.js +0 -80
- package/src/scripts/Libraries/Dialog.js +0 -28
- package/src/scripts/Libraries/Form.js +0 -13
- package/src/scripts/Libraries/Naja.js +0 -37
- package/src/scripts/Libraries/ReCaptcha.js +0 -25
- package/src/scripts/Libraries/Reveal.js +0 -32
- package/src/scripts/Libraries/Ripple.js +0 -8
- package/src/scripts/Libraries/Stimulus.js +0 -56
- package/src/scripts/Libraries/Swup.js +0 -77
- package/src/scripts/Libraries/Toaster.js +0 -55
- package/src/scripts/Sections/+.js +0 -0
- package/src/scripts/Ui/+.js +0 -4
- package/src/scripts/Ui/Check.js +0 -8
- package/src/scripts/Ui/Control.js +0 -194
- package/src/scripts/Ui/ControlSelect.js +0 -25
- package/src/scripts/Ui/Text.js +0 -21
- package/src/scripts/Utils/+.js +0 -3
- package/src/scripts/Utils/cdn.js +0 -5
- package/src/scripts/Utils/naja.js +0 -41
- package/src/scripts/Utils/utilities.js +0 -8
- package/src/styles/Components/+.css +0 -5
- package/src/styles/Components/Dialog/+.css +0 -3
- package/src/styles/Components/Dialog/Content.css +0 -2
- package/src/styles/Components/Dialog/Default.css +0 -2
- package/src/styles/Components/Drawer.css +0 -18
- package/src/styles/Layout/+.css +0 -3
- package/src/styles/Layout/Header.css +0 -18
- package/src/styles/Layout/Nav.css +0 -23
- package/src/styles/Libraries/+.css +0 -2
- package/src/styles/Libraries/Datepicker.css +0 -54
- package/src/styles/Libraries/Pickr.css +0 -13
- package/src/styles/Sections/+.css +0 -1
- package/src/styles/Ui/+.css +0 -16
- package/src/styles/Ui/Badge.css +0 -8
- package/src/styles/Ui/Btn.css +0 -14
- package/src/styles/Ui/Check.css +0 -1
- package/src/styles/Ui/Control.css +0 -57
- package/src/styles/Ui/ControlSelect.css +0 -57
- package/src/styles/Ui/Group.css +0 -1
- package/src/styles/Ui/Heading.css +0 -4
- package/src/styles/Ui/Image.css +0 -1
- package/src/styles/Ui/Info.css +0 -1
- package/src/styles/Ui/Label.css +0 -1
- package/src/styles/Ui/Link.css +0 -8
- package/src/styles/Ui/Notice.css +0 -9
- package/src/styles/Ui/Progress.css +0 -1
- package/src/styles/Ui/Switch.css +0 -1
- package/src/styles/Ui/Text.css +0 -1
- package/src/styles/Ui/Title.css +0 -4
- package/src/styles/Utils/+.css +0 -6
- package/src/styles/Utils/config.css +0 -16
- package/src/styles/Utils/theme/+.css +0 -1
- package/src/styles/Utils/theme/main.css +0 -33
- package/src/styles/Utils/utilities.css +0 -42
- package/src/templates/Components/Dialog/Basic.latte +0 -24
- package/src/templates/Components/Dialog/CookieConsent.latte +0 -27
- package/src/templates/Layout/Footer.latte +0 -0
- package/src/templates/Layout/Header.latte +0 -38
- package/src/templates/Sections/Site.latte +0 -213
- package/src/templates/Sections/Ui/Docs/@intro.html +0 -48
- package/src/templates/Sections/Ui/Docs/@nav.html +0 -134
- package/src/templates/Sections/Ui/Docs/@styles.html +0 -96
- package/src/templates/Sections/Ui/Docs/Default.latte +0 -979
- package/src/templates/Sections/Ui/Icons.html +0 -30
- package/src/templates/Sections/Ui/Intro.html +0 -119
- package/src/templates/Sections/Ui.latte +0 -8
- package/src/templates/Ui/+.latte +0 -5
- package/src/templates/Ui/Check.latte +0 -7
- package/src/templates/Ui/Control.latte +0 -9
- package/src/templates/Ui/ControlDate.latte +0 -14
- package/src/templates/Ui/ControlSelect.latte +0 -9
- package/src/templates/Ui/ControlTime.latte +0 -14
- package/src/views/dialog/basic.json.latte +0 -5
- package/src/views/email/email.latte +0 -6
- package/src/views/email/email.test.latte +0 -6
- package/src/views/gdpr.json +0 -14
- package/src/views/index.json +0 -12
- package/src/views/popover/info.json.latte +0 -15
- package/src/views/site.json +0 -11
- package/src/views/ui-icons.json +0 -12
- package/src/views/ui.json +0 -11
- /package/src/styles/{Utils → base}/breakpoints.css +0 -0
- /package/src/styles/{Utils → base}/keyframes.css +0 -0
- /package/src/styles/{Components → components/(ui)}/Field.css +0 -0
- /package/src/styles/{Components → components/(ui)}/Popover.css +0 -0
- /package/src/styles/{Components → components/(ui)}/Toaster.css +0 -0
- /package/src/{emails/styles/main/Base/font.css → styles/emails/base/fonts.css} +0 -0
- /package/src/templates/{Utils → utils}/sections.latte +0 -0
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import cdn from '../Utils/cdn.js'
|
|
2
|
-
import { LibStimulus, Controller } from '../Libraries/Stimulus.js'
|
|
3
|
-
import { importStyle } from '@newlogic-digital/utils-js'
|
|
4
|
-
import { validateField } from 'winduum/src/components/form/index.js'
|
|
5
|
-
|
|
6
|
-
LibStimulus.register('ui-control', class extends Controller {
|
|
7
|
-
static targets = ['number']
|
|
8
|
-
|
|
9
|
-
static values = {
|
|
10
|
-
dateOptions: {
|
|
11
|
-
default: {},
|
|
12
|
-
type: Object
|
|
13
|
-
},
|
|
14
|
-
dateDisabled: {
|
|
15
|
-
default: [],
|
|
16
|
-
type: Array
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async connect() {
|
|
21
|
-
validateField(this.element, { validate: false })
|
|
22
|
-
|
|
23
|
-
this.element.addEventListener('change', () => validateField(this.element))
|
|
24
|
-
|
|
25
|
-
if (this.element.querySelector('select')) {
|
|
26
|
-
return
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
this.typeNumber()
|
|
30
|
-
|
|
31
|
-
await this.typeDate()
|
|
32
|
-
|
|
33
|
-
await this.typeColor()
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async typeDate() {
|
|
37
|
-
const input = this.element.querySelector('[type^="date"], [type="month"]')
|
|
38
|
-
|
|
39
|
-
if (input) {
|
|
40
|
-
const AirDatepicker = (await import('air-datepicker')).default
|
|
41
|
-
const localeUrl = cdn.datepickerLang
|
|
42
|
-
const locale = (await import(/* @vite-ignore */ localeUrl)).default.default
|
|
43
|
-
const minDate = input.min ?? ''
|
|
44
|
-
const maxDate = input.max ?? ''
|
|
45
|
-
const timepicker = input.type === 'datetime-local'
|
|
46
|
-
const monthView = input.type === 'month'
|
|
47
|
-
? {
|
|
48
|
-
view: 'months',
|
|
49
|
-
minView: 'months',
|
|
50
|
-
dateFormat: 'MMMM yyyy',
|
|
51
|
-
altFieldDateFormat: 'yyyy-MM'
|
|
52
|
-
}
|
|
53
|
-
: {}
|
|
54
|
-
|
|
55
|
-
const attributes = [...input.attributes].filter(({ name }) => name.match(/(required|placeholder)/)).map(({ name, value }) => `${name}="${value}"`).join(' ')
|
|
56
|
-
|
|
57
|
-
input.setAttribute('type', 'hidden')
|
|
58
|
-
|
|
59
|
-
input.insertAdjacentHTML('afterend', `<input type="text" inputmode="none" ${attributes}>`)
|
|
60
|
-
|
|
61
|
-
const inputText = this.element.querySelector('[type="text"]')
|
|
62
|
-
|
|
63
|
-
if (input.id) {
|
|
64
|
-
inputText.id = input.id + '-datepicker'
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
inputText.addEventListener('keydown', (e) => {
|
|
68
|
-
const key = e.key.toLowerCase()
|
|
69
|
-
|
|
70
|
-
if (key !== 'backspace' && key !== 'tab') {
|
|
71
|
-
e.preventDefault()
|
|
72
|
-
} else if (key === 'backspace') {
|
|
73
|
-
this.datepicker.clear()
|
|
74
|
-
inputText.dispatchEvent(new Event('change', { bubbles: true }))
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
this.datepicker = new AirDatepicker(inputText, {
|
|
79
|
-
locale,
|
|
80
|
-
timepicker,
|
|
81
|
-
minDate,
|
|
82
|
-
maxDate,
|
|
83
|
-
startDate: input.value,
|
|
84
|
-
selectedDates: input.value,
|
|
85
|
-
altField: input,
|
|
86
|
-
autoClose: true,
|
|
87
|
-
container: this.element,
|
|
88
|
-
minutesStep: 5,
|
|
89
|
-
altFieldDateFormat: 'yyyy-MM-dd',
|
|
90
|
-
buttons: ['today', 'clear'],
|
|
91
|
-
...monthView,
|
|
92
|
-
...this.dateOptionsValue,
|
|
93
|
-
onRenderCell: ({ date, cellType }) => {
|
|
94
|
-
if (cellType === 'day' && this.dateDisabledValue.includes(this.datepicker.formatDate(date, 'yyyy-MM-dd'))) {
|
|
95
|
-
return {
|
|
96
|
-
disabled: true
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
onShow: () => {
|
|
101
|
-
this.datepicker.$datepicker.querySelectorAll('.air-datepicker-button').forEach((element) => {
|
|
102
|
-
element.setAttribute('type', 'button')
|
|
103
|
-
element.setAttribute('tabindex', '-1')
|
|
104
|
-
})
|
|
105
|
-
},
|
|
106
|
-
onSelect: ({ date }) => {
|
|
107
|
-
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
async typeColor() {
|
|
114
|
-
if (this.element.querySelector('[type="color"]') !== null) {
|
|
115
|
-
const Pickr = (await import('@simonwep/pickr')).default
|
|
116
|
-
const input = this.element.querySelector('input')
|
|
117
|
-
|
|
118
|
-
await importStyle(cdn.pickrCss)
|
|
119
|
-
|
|
120
|
-
input.setAttribute('inputmode', 'none')
|
|
121
|
-
input.setAttribute('type', 'text')
|
|
122
|
-
input.setAttribute('maxlength', '9')
|
|
123
|
-
input.setAttribute('pattern', '^#?([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$')
|
|
124
|
-
|
|
125
|
-
this.element.insertAdjacentHTML('afterbegin', '<div class="me-auto"><div class="color"></div></div>')
|
|
126
|
-
|
|
127
|
-
const pickr = new Pickr({
|
|
128
|
-
el: input,
|
|
129
|
-
useAsButton: true,
|
|
130
|
-
theme: 'nano',
|
|
131
|
-
position: 'bottom-start',
|
|
132
|
-
components: {
|
|
133
|
-
preview: true,
|
|
134
|
-
opacity: true,
|
|
135
|
-
hue: true,
|
|
136
|
-
interaction: {
|
|
137
|
-
hex: true,
|
|
138
|
-
rgba: true,
|
|
139
|
-
input: true
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}).on('init', (pickr) => {
|
|
143
|
-
pickr.setColor(input.value)
|
|
144
|
-
}).on('change', (color) => {
|
|
145
|
-
input.value = color.toHEXA().toString()
|
|
146
|
-
this.element.querySelector('.color').style['background-color'] = color.toHEXA().toString()
|
|
147
|
-
}).on('hide', (pickr) => {
|
|
148
|
-
pickr.applyColor()
|
|
149
|
-
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
input.addEventListener('change', ({ target }) => {
|
|
153
|
-
pickr.setColor(target.value)
|
|
154
|
-
})
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
typeNumber() {
|
|
159
|
-
if (this.element.querySelector('[type="number"]') && !this.hasNumberTarget) {
|
|
160
|
-
if (!this.element.querySelector('.ms-auto')) {
|
|
161
|
-
this.element.insertAdjacentHTML('beforeend', '<div class="ms-auto"></div>')
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
this.element.querySelector('.ms-auto').insertAdjacentHTML('beforeend', `
|
|
165
|
-
<div class="flex flex-col gap-0 justify-center -space-y-1 -me-0.5" data-ui-control-target="number">
|
|
166
|
-
<button class="focus-visible:text-accent" type="button" data-action="click->ui-control#stepUp">
|
|
167
|
-
<svg class="size-4"><use href="#icon-angle-up-solid"></use></svg>
|
|
168
|
-
</button>
|
|
169
|
-
<button class="focus-visible:text-accent" type="button" data-action="click->ui-control#stepDown">
|
|
170
|
-
<svg class="size-4"><use href="#icon-angle-down-solid"></use></svg>
|
|
171
|
-
</button>
|
|
172
|
-
</div>
|
|
173
|
-
`)
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
stepUp() {
|
|
178
|
-
this.element.querySelector('input:not([hidden])').stepUp()
|
|
179
|
-
this.element.querySelector('input:not([hidden])').dispatchEvent(new Event('change', { bubbles: true }))
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
stepDown() {
|
|
183
|
-
this.element.querySelector('input:not([hidden])').stepDown()
|
|
184
|
-
this.element.querySelector('input:not([hidden])').dispatchEvent(new Event('change', { bubbles: true }))
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
showPicker() {
|
|
188
|
-
this.element.querySelector('input:not([hidden])').showPicker()
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
showDatepicker() {
|
|
192
|
-
this.datepicker.$el.focus()
|
|
193
|
-
}
|
|
194
|
-
})
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { LibStimulus, Controller } from '../Libraries/Stimulus.js'
|
|
2
|
-
import { dataset } from '@newlogic-digital/utils-js'
|
|
3
|
-
|
|
4
|
-
LibStimulus.register('ui-control-select', class extends Controller {
|
|
5
|
-
connect() {
|
|
6
|
-
this.select = this.element.querySelector('select')
|
|
7
|
-
const option = this.element.querySelectorAll('[data-option]')
|
|
8
|
-
|
|
9
|
-
if (option[0]) {
|
|
10
|
-
option.forEach((option) => {
|
|
11
|
-
if (option.dataset.disabled) {
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
dataset(option, 'action').add('click->ui-control-select#choose', 'keydown.enter->ui-control-select#choose')
|
|
16
|
-
})
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
choose({ currentTarget }) {
|
|
21
|
-
this.select.value = currentTarget.dataset.option
|
|
22
|
-
this.select.dispatchEvent(new Event('change', { bubbles: true }))
|
|
23
|
-
document.activeElement.blur()
|
|
24
|
-
}
|
|
25
|
-
})
|
package/src/scripts/Ui/Text.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { LibStimulus, Controller } from '../Libraries/Stimulus.js'
|
|
2
|
-
|
|
3
|
-
LibStimulus.register('ui-text', class extends Controller {
|
|
4
|
-
connect() {
|
|
5
|
-
function wrap(element, wrapper) {
|
|
6
|
-
element.parentNode.insertBefore(wrapper, element)
|
|
7
|
-
wrapper.appendChild(element)
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
this.element.querySelectorAll('table').forEach((table) => {
|
|
11
|
-
wrap(table, new DOMParser().parseFromString('<div class="overflow-x-auto max-w-full"></div>', 'text/html').body.firstChild)
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
this.element.querySelectorAll('iframe').forEach((iframe) => {
|
|
15
|
-
if (iframe.width && iframe.height) {
|
|
16
|
-
iframe.style.aspectRatio = iframe.width + '/' + iframe.height
|
|
17
|
-
iframe.style.height = 'auto'
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
}
|
|
21
|
-
})
|
package/src/scripts/Utils/+.js
DELETED
package/src/scripts/Utils/cdn.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
recaptcha: 'https://www.google.com/recaptcha/enterprise.js?render={apikey}',
|
|
3
|
-
pickrCss: 'https://cdn.jsdelivr.net/npm/@simonwep/pickr@1.8.2/dist/themes/nano.min.css',
|
|
4
|
-
datepickerLang: `https://cdn.jsdelivr.net/npm/air-datepicker@3.3.5/locale/${document.documentElement.lang}.js/+esm`
|
|
5
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import naja from 'naja'
|
|
2
|
-
|
|
3
|
-
export const initNaja = (element, bindUI = true, selectors = 'button, [role="button"]') => {
|
|
4
|
-
bindUI && naja.uiHandler.bindUI(element)
|
|
5
|
-
|
|
6
|
-
element.querySelectorAll(`:where(${selectors})${naja.uiHandler.selector}`).forEach((element) => {
|
|
7
|
-
if (element.form && element.type === 'submit') return
|
|
8
|
-
|
|
9
|
-
element.addEventListener('click', (event) => {
|
|
10
|
-
naja.uiHandler.processInteraction(element, element.dataset.najaMethod ?? 'GET', element.dataset.najaUrl, element.dataset.najaData, {}, event)
|
|
11
|
-
})
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const NajaFormValidityExtension = {
|
|
16
|
-
initialize(naja) {
|
|
17
|
-
naja.uiHandler.addEventListener('interaction', (event) => {
|
|
18
|
-
const { element } = event.detail
|
|
19
|
-
|
|
20
|
-
if (element?.form && !element.form.reportValidity()) {
|
|
21
|
-
event.preventDefault()
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const NajaRecaptchaExtension = {
|
|
28
|
-
initialize(naja) {
|
|
29
|
-
naja.uiHandler.addEventListener('interaction', (event) => {
|
|
30
|
-
const { element } = event.detail
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
(element.form ?? element)?.dataset?.controller?.includes('lib-recaptcha')
|
|
34
|
-
&& !event.detail?.originalEvent?.detail?.recaptchaExecuted
|
|
35
|
-
) {
|
|
36
|
-
event.preventDefault()
|
|
37
|
-
return false
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Controller, LibStimulus } from '../Libraries/Stimulus.js'
|
|
2
|
-
|
|
3
|
-
LibStimulus.register('utils', class extends Controller {
|
|
4
|
-
darkMode() {
|
|
5
|
-
document.documentElement.classList.toggle('dark')
|
|
6
|
-
localStorage.theme = document.documentElement.classList.contains('dark') ? 'dark' : 'light'
|
|
7
|
-
}
|
|
8
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
@import "winduum/src/components/drawer/default-props.css";
|
|
2
|
-
@import "winduum/src/components/drawer/default.css";
|
|
3
|
-
@import "winduum/src/components/drawer/content-props.css";
|
|
4
|
-
@import "winduum/src/components/drawer/content.css";
|
|
5
|
-
|
|
6
|
-
.c-drawer {
|
|
7
|
-
--c-drawer-content-width: min(calc(100vw - 2rem), 22rem);
|
|
8
|
-
--c-drawer-content-height: 100dvh;
|
|
9
|
-
|
|
10
|
-
&:not(.active) {
|
|
11
|
-
opacity: 0;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.c-drawer-content {
|
|
16
|
-
overflow-y: auto;
|
|
17
|
-
overscroll-behavior: contain;
|
|
18
|
-
}
|
package/src/styles/Layout/+.css
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--l-header-height: 4rem;
|
|
3
|
-
--l-scroll-padding-top: calc(var(--l-header-height) + 1rem);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.l-header {
|
|
7
|
-
position: sticky;
|
|
8
|
-
top: 0;
|
|
9
|
-
z-index: var(--z-20);
|
|
10
|
-
padding-inline: 2rem calc(2rem + var(--c-dialog-scrollbar-width, 0rem));
|
|
11
|
-
background-color: var(--color-dark);
|
|
12
|
-
color: var(--color-light);
|
|
13
|
-
height: var(--l-header-height);
|
|
14
|
-
|
|
15
|
-
.dark & {
|
|
16
|
-
background-color: var(--color-body-secondary);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.l-nav {
|
|
2
|
-
.c-drawer-content {
|
|
3
|
-
padding: 2rem;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
[data-part~="logo"] {
|
|
7
|
-
display: flex;
|
|
8
|
-
padding: 0.75rem 0 2.5rem;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
[data-part~="nav"] {
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
gap: 0.5rem;
|
|
15
|
-
align-items: flex-start;
|
|
16
|
-
|
|
17
|
-
& a {
|
|
18
|
-
padding: 0.5rem 0;
|
|
19
|
-
font-size: 1.75rem;
|
|
20
|
-
display: block;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
@import "air-datepicker/air-datepicker.css";
|
|
2
|
-
|
|
3
|
-
.air-datepicker {
|
|
4
|
-
--adp-btn-color: var(--color-primary);
|
|
5
|
-
--adp-day-name-color: var(--color-primary);
|
|
6
|
-
--adp-color-current-date: var(--color-main);
|
|
7
|
-
--adp-cell-background-color-selected: var(--color-primary);
|
|
8
|
-
--adp-cell-background-color-selected-hover: var(--color-primary);
|
|
9
|
-
--adp-cell-border-radius: var(--rounded);
|
|
10
|
-
--adp-border-radius: var(--rounded);
|
|
11
|
-
|
|
12
|
-
.dark & {
|
|
13
|
-
--adp-background-color: var(--color-body-tertiary);
|
|
14
|
-
--adp-background-color-hover: var(--color-body-secondary);
|
|
15
|
-
--adp-background-color-active: var(--color-body-secondary);
|
|
16
|
-
--adp-color: var(--color-main);
|
|
17
|
-
--adp-color-secondary: var(--color-main);
|
|
18
|
-
--adp-color-other-month: color-mix(in srgb, var(--color-main) 50%, var(--color-dark));
|
|
19
|
-
--adp-border-color: var(--color-body-secondary);
|
|
20
|
-
--adp-border-color-inner: var(--color-body-secondary);
|
|
21
|
-
--adp-border-color-inline: var(--color-body-secondary);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
font-family: inherit;
|
|
25
|
-
|
|
26
|
-
& input[type="range"] {
|
|
27
|
-
border: 0;
|
|
28
|
-
outline: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.air-datepicker--pointer {
|
|
32
|
-
&::after {
|
|
33
|
-
background: var(--adp-background-color);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.air-datepicker-cell {
|
|
38
|
-
&.-current- {
|
|
39
|
-
--sq: 0.25rem;
|
|
40
|
-
--bottom: 0.25rem;
|
|
41
|
-
|
|
42
|
-
&::before {
|
|
43
|
-
content: "";
|
|
44
|
-
width: var(--sq);
|
|
45
|
-
height: var(--sq);
|
|
46
|
-
border-radius: var(--rounded-full);
|
|
47
|
-
background-color: var(--color-success);
|
|
48
|
-
position: absolute;
|
|
49
|
-
bottom: var(--bottom);
|
|
50
|
-
left: calc(50% - var(--sq) / 2);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/* empty */
|
package/src/styles/Ui/+.css
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
@import "Badge.css";
|
|
2
|
-
@import "Btn.css";
|
|
3
|
-
@import "Check.css";
|
|
4
|
-
@import "Control.css";
|
|
5
|
-
@import "ControlSelect.css";
|
|
6
|
-
@import "Group.css";
|
|
7
|
-
@import "Heading.css";
|
|
8
|
-
@import "Image.css";
|
|
9
|
-
@import "Info.css";
|
|
10
|
-
@import "Label.css";
|
|
11
|
-
@import "Link.css";
|
|
12
|
-
@import "Notice.css";
|
|
13
|
-
@import "Progress.css";
|
|
14
|
-
@import "Switch.css";
|
|
15
|
-
@import "Text.css";
|
|
16
|
-
@import "Title.css";
|
package/src/styles/Ui/Badge.css
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
@import "winduum/src/ui/badge/default.css";
|
|
2
|
-
@import "winduum/src/ui/badge/default-props.css";
|
|
3
|
-
@import "winduum/src/ui/badge/sm.css";
|
|
4
|
-
@import "winduum/src/ui/badge/lg.css";
|
|
5
|
-
@import "winduum/src/ui/badge/bordered.css";
|
|
6
|
-
@import "winduum/src/ui/badge/muted.css";
|
|
7
|
-
@import "winduum/src/ui/badge/square.css";
|
|
8
|
-
@import "winduum/src/ui/badge/circle.css";
|
package/src/styles/Ui/Btn.css
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
@import "winduum/src/ui/btn/default.css";
|
|
2
|
-
@import "winduum/src/ui/btn/default-props.css";
|
|
3
|
-
@import "winduum/src/ui/btn/lg.css";
|
|
4
|
-
@import "winduum/src/ui/btn/sm.css";
|
|
5
|
-
@import "winduum/src/ui/btn/interactive.css";
|
|
6
|
-
@import "winduum/src/ui/btn/interactive-props.css";
|
|
7
|
-
@import "winduum/src/ui/btn/loading.css";
|
|
8
|
-
@import "winduum/src/ui/btn/loading-props.css";
|
|
9
|
-
@import "winduum/src/ui/btn/wide.css";
|
|
10
|
-
@import "winduum/src/ui/btn/bordered.css";
|
|
11
|
-
@import "winduum/src/ui/btn/ghosted.css";
|
|
12
|
-
@import "winduum/src/ui/btn/muted.css";
|
|
13
|
-
@import "winduum/src/ui/btn/square.css";
|
|
14
|
-
@import "winduum/src/ui/btn/circle.css";
|
package/src/styles/Ui/Check.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "winduum/src/ui/check/index.css";
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
@import "winduum/src/ui/control/default.css";
|
|
2
|
-
@import "winduum/src/ui/control/default-props.css";
|
|
3
|
-
@import "winduum/src/ui/control/interactive.css";
|
|
4
|
-
@import "winduum/src/ui/control/interactive-props.css";
|
|
5
|
-
@import "winduum/src/ui/control/file.css";
|
|
6
|
-
@import "winduum/src/ui/control/select.css";
|
|
7
|
-
@import "winduum/src/ui/control/select-props.css";
|
|
8
|
-
@import "winduum/src/ui/control/icon.css";
|
|
9
|
-
@import "winduum/src/ui/control/icon-props.css";
|
|
10
|
-
@import "winduum/src/ui/control/floating.css";
|
|
11
|
-
@import "winduum/src/ui/control/floating-props.css";
|
|
12
|
-
@import "winduum/src/ui/control/invalid.css";
|
|
13
|
-
|
|
14
|
-
.ui-control {
|
|
15
|
-
--ui-control-font-size: var(--text-sm);
|
|
16
|
-
|
|
17
|
-
&.active label,
|
|
18
|
-
:where(input, textarea):is(:focus, [placeholder]) ~ label,
|
|
19
|
-
:where(select):is([data-placeholder]) ~ label,
|
|
20
|
-
&:has(.-active-) label {
|
|
21
|
-
transform: translateY(calc(var(--ui-control-label-translate-y) * -1)) scale(var(--ui-control-label-scale));
|
|
22
|
-
opacity: var(--ui-control-label-focus-opacity, 0.5);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&:has(label):not(.active) select:not([data-placeholder]) {
|
|
26
|
-
font-size: 0;
|
|
27
|
-
height: inherit;
|
|
28
|
-
|
|
29
|
-
& option {
|
|
30
|
-
font-size: var(--ui-control-font-size);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:where(.color) {
|
|
35
|
-
width: var(--ui-control-icon-size);
|
|
36
|
-
height: var(--ui-control-icon-size);
|
|
37
|
-
border-radius: 50%;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
display: block;
|
|
40
|
-
border: 1px solid rgb(0 0 0 / 15%);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:where([type="number"]) {
|
|
44
|
-
-moz-appearance: textfield;
|
|
45
|
-
|
|
46
|
-
&::-webkit-outer-spin-button,
|
|
47
|
-
&::-webkit-inner-spin-button {
|
|
48
|
-
-webkit-appearance: none;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
:where(input) {
|
|
53
|
-
&::-webkit-calendar-picker-indicator {
|
|
54
|
-
display: none;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
.ui-control[data-controller~="ui-control-select"] {
|
|
2
|
-
position: relative;
|
|
3
|
-
cursor: pointer;
|
|
4
|
-
|
|
5
|
-
& select {
|
|
6
|
-
pointer-events: none;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
& div[aria-hidden] {
|
|
10
|
-
grid-area: c-control;
|
|
11
|
-
will-change: transform;
|
|
12
|
-
border-radius: inherit;
|
|
13
|
-
position: absolute;
|
|
14
|
-
background-color: var(--color-body);
|
|
15
|
-
z-index: 100;
|
|
16
|
-
inset-inline: 0;
|
|
17
|
-
top: 100%;
|
|
18
|
-
margin-top: 0.5rem;
|
|
19
|
-
border: 1px solid color-mix(in srgb, currentcolor 10%, transparent);
|
|
20
|
-
transform: scaleY(0);
|
|
21
|
-
opacity: 0;
|
|
22
|
-
transition: var(--transition-opacity), var(--transition-transform);
|
|
23
|
-
transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);
|
|
24
|
-
transition-duration: 200ms;
|
|
25
|
-
backface-visibility: hidden;
|
|
26
|
-
transform-origin: center top;
|
|
27
|
-
user-select: none;
|
|
28
|
-
max-height: 12rem;
|
|
29
|
-
overflow-y: auto;
|
|
30
|
-
box-shadow: 0 0.15em 1.5em 0 color-mix(in srgb, var(--color-dark) 5%, transparent), 0 0 1em 0 color-mix(in srgb, var(--color-dark) 5%, transparent);
|
|
31
|
-
padding: 0.375rem;
|
|
32
|
-
color: currentcolor;
|
|
33
|
-
cursor: default;
|
|
34
|
-
|
|
35
|
-
& [data-option] {
|
|
36
|
-
padding: calc(var(--ui-control-px) / 1.5) var(--ui-control-px);
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
transition: var(--transition-background);
|
|
39
|
-
font-size: var(--ui-control-font-size);
|
|
40
|
-
border-radius: inherit;
|
|
41
|
-
|
|
42
|
-
&[data-disabled] {
|
|
43
|
-
opacity: 0.5;
|
|
44
|
-
pointer-events: none;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&:is(:hover, :focus) {
|
|
48
|
-
background-color: color-mix(in srgb, var(--color-accent) 10%, transparent);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&:focus-within select ~ div[aria-hidden] {
|
|
54
|
-
opacity: 1;
|
|
55
|
-
transform: none;
|
|
56
|
-
}
|
|
57
|
-
}
|
package/src/styles/Ui/Group.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "winduum/src/ui/group/index.css";
|
package/src/styles/Ui/Image.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "winduum/src/ui/image/index.css";
|
package/src/styles/Ui/Info.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "winduum/src/ui/info/index.css";
|
package/src/styles/Ui/Label.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "winduum/src/ui/label/index.css";
|
package/src/styles/Ui/Link.css
DELETED