@finsweet/webflow-apps-utils 1.0.2 → 1.0.3
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 +162 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/providers/GlobalProvider.mdx +322 -0
- package/dist/providers/GlobalProvider.svelte +58 -0
- package/dist/providers/GlobalProvider.svelte.d.ts +4 -0
- package/dist/providers/configuratorUtils.d.ts +37 -0
- package/dist/providers/configuratorUtils.js +219 -0
- package/dist/providers/globalContext.svelte.d.ts +18 -0
- package/dist/providers/globalContext.svelte.js +439 -0
- package/dist/providers/index.d.ts +5 -0
- package/dist/providers/index.js +7 -0
- package/dist/providers/types.d.ts +103 -0
- package/dist/providers/types.js +6 -0
- package/dist/router/README.md +2 -2
- package/dist/stores/index.d.ts +0 -1
- package/dist/stores/index.js +0 -1
- package/dist/types/webflow.d.ts +31 -47
- package/dist/ui/components/LoadingScreen.svelte +2 -1
- package/dist/ui/components/button/Button.svelte +1 -1
- package/dist/ui/components/button-group/ButtonGroup.stories.js +112 -0
- package/dist/ui/components/{ButtonGroup.svelte → button-group/ButtonGroup.svelte} +20 -33
- package/dist/ui/components/button-group/ButtonGroup.svelte.d.ts +13 -0
- package/dist/ui/components/button-group/index.d.ts +2 -0
- package/dist/ui/components/button-group/index.js +1 -0
- package/dist/ui/components/button-group/types.d.ts +32 -0
- package/dist/ui/components/checkbox/Checkbox.stories.d.ts +55 -0
- package/dist/ui/components/checkbox/Checkbox.stories.js +162 -0
- package/dist/ui/components/checkbox/Checkbox.svelte +141 -0
- package/dist/ui/components/checkbox/Checkbox.svelte.d.ts +4 -0
- package/dist/ui/components/checkbox/index.d.ts +2 -0
- package/dist/ui/components/checkbox/index.js +1 -0
- package/dist/ui/components/checkbox/types.d.ts +32 -0
- package/dist/ui/components/controlled-buttons/ControlledButtons.stories.d.ts +32 -0
- package/dist/ui/components/controlled-buttons/ControlledButtons.stories.js +152 -0
- package/dist/ui/components/{buttons/FooterButton.svelte → controlled-buttons/ControlledButtons.svelte} +18 -67
- package/dist/ui/components/controlled-buttons/ControlledButtons.svelte.d.ts +4 -0
- package/dist/ui/components/controlled-buttons/index.d.ts +2 -0
- package/dist/ui/components/controlled-buttons/index.js +1 -0
- package/dist/ui/components/{buttons → controlled-buttons}/types.d.ts +11 -4
- package/dist/ui/components/divider/Divider.stories.svelte +134 -0
- package/dist/ui/components/{clickable/Clickable.stories.svelte.d.ts → divider/Divider.stories.svelte.d.ts} +4 -4
- package/dist/ui/components/divider/Divider.svelte +30 -0
- package/dist/ui/components/divider/Divider.svelte.d.ts +4 -0
- package/dist/ui/components/divider/index.d.ts +2 -0
- package/dist/ui/components/divider/index.js +1 -0
- package/dist/ui/components/divider/types.d.ts +23 -0
- package/dist/ui/components/divider/types.js +1 -0
- package/dist/ui/components/iframe/Iframe.stories.svelte +122 -0
- package/dist/ui/components/{ToggleItem.svelte.d.ts → iframe/Iframe.stories.svelte.d.ts} +7 -8
- package/dist/ui/components/iframe/Iframe.svelte +75 -0
- package/dist/ui/components/iframe/Iframe.svelte.d.ts +4 -0
- package/dist/ui/components/iframe/index.d.ts +2 -0
- package/dist/ui/components/iframe/index.js +1 -0
- package/dist/ui/components/iframe/types.d.ts +38 -0
- package/dist/ui/components/iframe/types.js +1 -0
- package/dist/ui/components/index.d.ts +12 -39
- package/dist/ui/components/index.js +12 -39
- package/dist/ui/components/input/Input.stories.d.ts +24 -0
- package/dist/ui/components/input/Input.stories.js +98 -0
- package/dist/ui/components/input/Input.svelte +321 -80
- package/dist/ui/components/input/types.d.ts +27 -1
- package/dist/ui/components/layout/Layout.stories.svelte +3 -3
- package/dist/ui/components/layout/Layout.svelte +3 -5
- package/dist/ui/components/layout/common/EditModeMessage.svelte +24 -12
- package/dist/ui/components/layout/{ExampleLayout.svelte → examples/ExampleLayout.svelte} +34 -22
- package/dist/ui/components/layout/examples/Wrapper.svelte +9 -0
- package/dist/ui/components/{NoSettingsNeeded.svelte.d.ts → layout/examples/Wrapper.svelte.d.ts} +3 -3
- package/dist/ui/components/layout/examples/index.d.ts +2 -0
- package/dist/ui/components/layout/examples/index.js +2 -0
- package/dist/ui/components/layout/index.d.ts +2 -1
- package/dist/ui/components/layout/index.js +2 -1
- package/dist/ui/components/modal/Example.svelte +320 -0
- package/dist/ui/components/modal/Example.svelte.d.ts +3 -0
- package/dist/ui/components/modal/Modal.stories.svelte +18 -0
- package/dist/ui/components/modal/Modal.stories.svelte.d.ts +26 -0
- package/dist/ui/components/modal/Modal.svelte +490 -0
- package/dist/ui/components/modal/Modal.svelte.d.ts +130 -0
- package/dist/ui/components/modal/index.d.ts +2 -0
- package/dist/ui/components/modal/index.js +1 -0
- package/dist/ui/components/modal/types.d.ts +75 -0
- package/dist/ui/components/modal/types.js +1 -0
- package/dist/ui/components/notification/Notification.stories.svelte +228 -0
- package/dist/ui/components/{ToggleList.svelte.d.ts → notification/Notification.stories.svelte.d.ts} +9 -21
- package/dist/ui/components/notification/Notification.svelte +289 -0
- package/dist/ui/components/notification/Notification.svelte.d.ts +67 -0
- package/dist/ui/components/notification/index.d.ts +2 -0
- package/dist/ui/components/notification/index.js +1 -0
- package/dist/ui/components/notification/types.d.ts +68 -0
- package/dist/ui/components/notification/types.js +1 -0
- package/dist/ui/components/section/Section.stories.svelte +263 -0
- package/dist/ui/components/section/Section.stories.svelte.d.ts +27 -0
- package/dist/ui/components/section/Section.svelte +324 -0
- package/dist/ui/components/section/Section.svelte.d.ts +5 -0
- package/dist/ui/components/section/index.d.ts +2 -0
- package/dist/ui/components/section/index.js +1 -0
- package/dist/ui/components/section/types.d.ts +106 -0
- package/dist/ui/components/section/types.js +1 -0
- package/dist/ui/components/{ImageUpload.svelte → shared/ImageUpload.svelte} +3 -3
- package/dist/ui/components/{SelectBodyOrDivBlock.svelte → shared/SelectBodyOrDivBlock.svelte} +1 -1
- package/dist/ui/components/shared/index.d.ts +2 -0
- package/dist/ui/components/shared/index.js +2 -0
- package/dist/ui/index.css +33 -5
- package/dist/utils/api/checkIfAppModeIsDesign.d.ts +1 -2
- package/dist/utils/api/checkIfAppModeIsDesign.js +1 -2
- package/dist/utils/api/clipboard/handlePaste.d.ts +6 -37
- package/dist/utils/api/clipboard/handlePaste.js +2 -6
- package/dist/utils/api/getAllAssets.d.ts +1 -2
- package/dist/utils/api/getAllAssets.js +1 -2
- package/dist/utils/api/getFinsweetComponentsEnvironment.d.ts +1 -2
- package/dist/utils/api/getFinsweetComponentsEnvironment.js +3 -6
- package/dist/utils/api/index.d.ts +0 -1
- package/dist/utils/api/index.js +0 -1
- package/dist/utils/api/insertWithXSCP.d.ts +1 -2
- package/dist/utils/api/insertWithXSCP.js +1 -2
- package/dist/utils/auth/crossWindowLogin.d.ts +3 -0
- package/dist/utils/auth/crossWindowLogin.js +3 -0
- package/dist/utils/auth/index.d.ts +9 -25
- package/dist/utils/auth/index.js +9 -25
- package/dist/utils/browser-storage/localStorage.d.ts +4 -12
- package/dist/utils/browser-storage/localStorage.js +4 -12
- package/dist/utils/browser-storage/sessionStorage.d.ts +4 -12
- package/dist/utils/browser-storage/sessionStorage.js +4 -12
- package/dist/utils/custom-code/api.d.ts +3 -7
- package/dist/utils/custom-code/api.js +3 -7
- package/dist/utils/helpers/cleanupTooltipMessage.d.ts +1 -2
- package/dist/utils/helpers/cleanupTooltipMessage.js +1 -2
- package/dist/utils/helpers/goto.d.ts +1 -4
- package/dist/utils/helpers/goto.js +2 -7
- package/dist/utils/helpers/index.d.ts +1 -0
- package/dist/utils/helpers/index.js +1 -0
- package/dist/utils/helpers/noop.d.ts +1 -1
- package/dist/utils/helpers/noop.js +1 -1
- package/dist/utils/helpers/numbers.d.ts +4 -14
- package/dist/utils/helpers/numbers.js +4 -14
- package/dist/utils/helpers/objectsToModuleExports.d.ts +1 -3
- package/dist/utils/helpers/objectsToModuleExports.js +1 -3
- package/dist/utils/helpers/trimText.d.ts +1 -8
- package/dist/utils/helpers/trimText.js +1 -8
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/logger/index.d.ts +0 -2
- package/dist/utils/logger/index.js +0 -2
- package/dist/utils/webflow-canvas/attributes/getAllWebflowElementAttributes.d.ts +1 -3
- package/dist/utils/webflow-canvas/attributes/getAllWebflowElementAttributes.js +1 -3
- package/dist/utils/webflow-canvas/attributes/getInstanceNamesFromObject.d.ts +1 -5
- package/dist/utils/webflow-canvas/attributes/getInstanceNamesFromObject.js +1 -5
- package/dist/utils/webflow-canvas/attributes/getWebflowElementAttribute.d.ts +1 -4
- package/dist/utils/webflow-canvas/attributes/getWebflowElementAttribute.js +1 -4
- package/dist/utils/webflow-canvas/attributes/getWebflowElementTextContent.d.ts +1 -3
- package/dist/utils/webflow-canvas/attributes/getWebflowElementTextContent.js +1 -3
- package/dist/utils/webflow-canvas/attributes/removeWebflowElementAttribute.d.ts +1 -4
- package/dist/utils/webflow-canvas/attributes/removeWebflowElementAttribute.js +1 -4
- package/dist/utils/webflow-canvas/attributes/setStyles.d.ts +1 -3
- package/dist/utils/webflow-canvas/attributes/setStyles.js +1 -3
- package/dist/utils/webflow-canvas/attributes/setWebflowElementAttribute.d.ts +1 -8
- package/dist/utils/webflow-canvas/attributes/setWebflowElementAttribute.js +1 -13
- package/dist/utils/webflow-canvas/findInstanceElement.d.ts +0 -6
- package/dist/utils/webflow-canvas/findInstanceElement.js +1 -7
- package/dist/utils/webflow-canvas/getAllPages.d.ts +3 -10
- package/dist/utils/webflow-canvas/getAllPages.js +3 -10
- package/dist/utils/webflow-canvas/getSiteStagingUrl.d.ts +1 -4
- package/dist/utils/webflow-canvas/getSiteStagingUrl.js +1 -4
- package/dist/utils/webflow-canvas/index.d.ts +1 -0
- package/dist/utils/webflow-canvas/index.js +1 -0
- package/package.json +9 -2
- package/dist/stores/globalStore.d.ts +0 -10
- package/dist/stores/globalStore.js +0 -10
- package/dist/ui/components/ButtonGroup.svelte.d.ts +0 -28
- package/dist/ui/components/Checkbox.svelte +0 -94
- package/dist/ui/components/Checkbox.svelte.d.ts +0 -36
- package/dist/ui/components/Copy.svelte +0 -329
- package/dist/ui/components/Copy.svelte.d.ts +0 -35
- package/dist/ui/components/CustomModal.svelte +0 -192
- package/dist/ui/components/CustomModal.svelte.d.ts +0 -45
- package/dist/ui/components/DisableInEditMode.svelte +0 -66
- package/dist/ui/components/DisableInEditMode.svelte.d.ts +0 -33
- package/dist/ui/components/Divider.svelte +0 -31
- package/dist/ui/components/Divider.svelte.d.ts +0 -31
- package/dist/ui/components/Header.svelte +0 -30
- package/dist/ui/components/Header.svelte.d.ts +0 -20
- package/dist/ui/components/Iframe.svelte +0 -89
- package/dist/ui/components/Iframe.svelte.d.ts +0 -40
- package/dist/ui/components/InjectComponent.svelte +0 -297
- package/dist/ui/components/InjectComponent.svelte.d.ts +0 -27
- package/dist/ui/components/Modal.svelte +0 -139
- package/dist/ui/components/Modal.svelte.d.ts +0 -42
- package/dist/ui/components/Navbar.svelte +0 -132
- package/dist/ui/components/Navbar.svelte.d.ts +0 -29
- package/dist/ui/components/NoSettingsNeeded.svelte +0 -31
- package/dist/ui/components/Notification.svelte +0 -193
- package/dist/ui/components/Notification.svelte.d.ts +0 -64
- package/dist/ui/components/PlusMinusButton.svelte +0 -91
- package/dist/ui/components/PlusMinusButton.svelte.d.ts +0 -22
- package/dist/ui/components/PreviewBar.svelte +0 -40
- package/dist/ui/components/PreviewBar.svelte.d.ts +0 -20
- package/dist/ui/components/ScrollableContent.svelte +0 -18
- package/dist/ui/components/ScrollableContent.svelte.d.ts +0 -31
- package/dist/ui/components/Section.svelte +0 -97
- package/dist/ui/components/Section.svelte.d.ts +0 -50
- package/dist/ui/components/Spacer.svelte +0 -9
- package/dist/ui/components/Spacer.svelte.d.ts +0 -22
- package/dist/ui/components/SpinnerPlusMinus.svelte +0 -75
- package/dist/ui/components/SpinnerPlusMinus.svelte.d.ts +0 -23
- package/dist/ui/components/SpinnerUpDown.svelte +0 -194
- package/dist/ui/components/SpinnerUpDown.svelte.d.ts +0 -31
- package/dist/ui/components/Tabs.svelte +0 -71
- package/dist/ui/components/Tabs.svelte.d.ts +0 -26
- package/dist/ui/components/ToggleItem.svelte +0 -29
- package/dist/ui/components/ToggleList.svelte +0 -57
- package/dist/ui/components/buttons/FooterButton.svelte.d.ts +0 -10
- package/dist/ui/components/buttons/index.d.ts +0 -5
- package/dist/ui/components/buttons/index.js +0 -5
- package/dist/ui/components/clickable/Clickable.stories.svelte +0 -213
- package/dist/ui/components/clickable/Clickable.svelte +0 -93
- package/dist/ui/components/clickable/Clickable.svelte.d.ts +0 -4
- package/dist/ui/components/clickable/index.d.ts +0 -2
- package/dist/ui/components/clickable/index.js +0 -1
- package/dist/ui/components/clickable/types.d.ts +0 -17
- package/dist/utils/api/copyPaste/index.d.ts +0 -18
- /package/dist/ui/components/{buttons → button-group}/types.js +0 -0
- /package/dist/ui/components/{clickable → checkbox}/types.js +0 -0
- /package/dist/{utils/api/copyPaste/index.js → ui/components/controlled-buttons/types.js} +0 -0
- /package/dist/ui/components/layout/{ExampleLayout.svelte.d.ts → examples/ExampleLayout.svelte.d.ts} +0 -0
- /package/dist/ui/components/{ImageUpload.svelte.d.ts → shared/ImageUpload.svelte.d.ts} +0 -0
- /package/dist/ui/components/{SelectBodyOrDivBlock.svelte.d.ts → shared/SelectBodyOrDivBlock.svelte.d.ts} +0 -0
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { fn } from 'storybook/test';
|
|
4
|
-
|
|
5
|
-
import { CheckIcon, PlusIcon } from '../../icons';
|
|
6
|
-
import Clickable from './Clickable.svelte';
|
|
7
|
-
|
|
8
|
-
const { Story } = defineMeta({
|
|
9
|
-
title: 'UI/Clickable',
|
|
10
|
-
component: Clickable,
|
|
11
|
-
tags: ['autodocs'],
|
|
12
|
-
parameters: {
|
|
13
|
-
docs: {
|
|
14
|
-
description: {
|
|
15
|
-
component:
|
|
16
|
-
'A versatile clickable wrapper component that provides keyboard accessibility and interactive states. Use this when you need to make any content clickable with proper focus management and ARIA support.'
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
disabled: {
|
|
22
|
-
control: { type: 'boolean' },
|
|
23
|
-
description: 'Whether the clickable element is disabled'
|
|
24
|
-
},
|
|
25
|
-
class: {
|
|
26
|
-
control: { type: 'text' },
|
|
27
|
-
description: 'Additional CSS classes to apply'
|
|
28
|
-
},
|
|
29
|
-
onclick: {
|
|
30
|
-
action: 'clicked',
|
|
31
|
-
description: 'Click event handler'
|
|
32
|
-
},
|
|
33
|
-
onkeydown: {
|
|
34
|
-
action: 'keydown',
|
|
35
|
-
description: 'Keydown event handler'
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
args: {
|
|
39
|
-
onclick: fn(),
|
|
40
|
-
onkeydown: fn()
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<Story
|
|
46
|
-
name="Card"
|
|
47
|
-
parameters={{
|
|
48
|
-
docs: {
|
|
49
|
-
description: {
|
|
50
|
-
story:
|
|
51
|
-
'A card-style clickable element using design system colors and shadows. Perfect for dashboard items, settings panels, or any card-based UI.'
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}}
|
|
55
|
-
>
|
|
56
|
-
<Clickable class="story-card">
|
|
57
|
-
<div class="card-content">
|
|
58
|
-
<div class="card-header">
|
|
59
|
-
<CheckIcon />
|
|
60
|
-
<h3>Task Completed</h3>
|
|
61
|
-
</div>
|
|
62
|
-
<p class="card-description">
|
|
63
|
-
Click anywhere on this card to view details. Uses design system colors and proper hover
|
|
64
|
-
states.
|
|
65
|
-
</p>
|
|
66
|
-
<span class="card-timestamp">2 hours ago</span>
|
|
67
|
-
</div>
|
|
68
|
-
</Clickable>
|
|
69
|
-
</Story>
|
|
70
|
-
|
|
71
|
-
<Story
|
|
72
|
-
name="Action Button"
|
|
73
|
-
parameters={{
|
|
74
|
-
docs: {
|
|
75
|
-
description: {
|
|
76
|
-
story:
|
|
77
|
-
'A button-style clickable element that follows the design system styling. Use when you need custom button behavior or complex button content.'
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}}
|
|
81
|
-
>
|
|
82
|
-
<Clickable class="story-action-button">
|
|
83
|
-
<div class="action-content">
|
|
84
|
-
<PlusIcon />
|
|
85
|
-
<span>Add New Item</span>
|
|
86
|
-
</div>
|
|
87
|
-
</Clickable>
|
|
88
|
-
</Story>
|
|
89
|
-
|
|
90
|
-
<Story
|
|
91
|
-
name="Disabled"
|
|
92
|
-
parameters={{
|
|
93
|
-
docs: {
|
|
94
|
-
description: {
|
|
95
|
-
story:
|
|
96
|
-
'Shows the disabled state with reduced opacity and no pointer events. Maintains accessibility by setting proper ARIA attributes.'
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}}
|
|
100
|
-
>
|
|
101
|
-
<Clickable disabled class="story-card">
|
|
102
|
-
<div class="card-content">
|
|
103
|
-
<div class="card-header">
|
|
104
|
-
<PlusIcon />
|
|
105
|
-
<h3>Disabled Card</h3>
|
|
106
|
-
</div>
|
|
107
|
-
<p class="card-description">This card is disabled and cannot be clicked.</p>
|
|
108
|
-
</div>
|
|
109
|
-
</Clickable>
|
|
110
|
-
</Story>
|
|
111
|
-
|
|
112
|
-
<style>
|
|
113
|
-
:global(.story-card) {
|
|
114
|
-
display: block;
|
|
115
|
-
width: 100%;
|
|
116
|
-
max-width: 320px;
|
|
117
|
-
background: var(--background2, #353535);
|
|
118
|
-
border: 1px solid var(--border1, rgba(255, 255, 255, 0.13));
|
|
119
|
-
border-radius: var(--border-radius, 4px);
|
|
120
|
-
transition: all 0.2s ease;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
:global(.story-card:not(.disabled)) {
|
|
124
|
-
cursor: pointer;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
:global(.story-card:hover:not(.disabled)) {
|
|
128
|
-
background: var(--background3, #404040);
|
|
129
|
-
border-color: var(--border2, rgba(255, 255, 255, 0.16));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
:global(.story-card:focus-visible) {
|
|
133
|
-
outline: 2px solid var(--blueBorder, #007df0);
|
|
134
|
-
outline-offset: 2px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.card-content {
|
|
138
|
-
padding: var(--spacing-16, 16px);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.card-header {
|
|
142
|
-
display: flex;
|
|
143
|
-
align-items: center;
|
|
144
|
-
gap: var(--spacing-8, 8px);
|
|
145
|
-
margin-bottom: var(--spacing-8, 8px);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.card-header h3 {
|
|
149
|
-
margin: 0;
|
|
150
|
-
color: var(--text1, #ffffff);
|
|
151
|
-
font-size: var(--font-size-large, 12.5px);
|
|
152
|
-
font-weight: var(--font-weight-medium, 600);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.card-description {
|
|
156
|
-
margin: 0 0 var(--spacing-8, 8px) 0;
|
|
157
|
-
color: var(--text2, rgba(255, 255, 255, 0.67));
|
|
158
|
-
font-size: var(--font-size-small, 11.5px);
|
|
159
|
-
line-height: 1.4;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.card-timestamp {
|
|
163
|
-
color: var(--text3, rgba(255, 255, 255, 0.67));
|
|
164
|
-
font-size: var(--font-size-small, 11.5px);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
:global(.story-action-button) {
|
|
168
|
-
display: inline-flex;
|
|
169
|
-
background: var(
|
|
170
|
-
--actionSecondaryBackground,
|
|
171
|
-
linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.1) 100%),
|
|
172
|
-
#404040
|
|
173
|
-
);
|
|
174
|
-
border: 1px solid var(--border2, rgba(255, 255, 255, 0.16));
|
|
175
|
-
border-radius: var(--border-radius, 4px);
|
|
176
|
-
transition: all 0.2s ease;
|
|
177
|
-
box-shadow:
|
|
178
|
-
0px 0.5px 1px rgba(0, 0, 0, 0.8),
|
|
179
|
-
inset 0px 0.5px 0.5px rgba(255, 255, 255, 0.12);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
:global(.story-action-button:not(.disabled)) {
|
|
183
|
-
cursor: pointer;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
:global(.story-action-button:hover:not(.disabled)) {
|
|
187
|
-
background: var(
|
|
188
|
-
--actionSecondaryBackgroundHover,
|
|
189
|
-
linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.16) 100%)
|
|
190
|
-
);
|
|
191
|
-
border-color: var(--border3, rgba(255, 255, 255, 0.19));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
:global(.story-action-button:focus-visible) {
|
|
195
|
-
outline: 2px solid var(--blueBorder, #007df0);
|
|
196
|
-
outline-offset: 2px;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
:global(.story-action-button:active:not(.disabled)) {
|
|
200
|
-
background: var(--defaultLightActive, rgba(255, 255, 255, 0.03));
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.action-content {
|
|
204
|
-
display: flex;
|
|
205
|
-
align-items: center;
|
|
206
|
-
gap: var(--spacing-8, 8px);
|
|
207
|
-
padding: var(--spacing-8, 8px) var(--spacing-12, 12px);
|
|
208
|
-
color: var(--actionSecondaryText, #e0e0e0);
|
|
209
|
-
font-size: var(--font-size-small, 11.5px);
|
|
210
|
-
font-weight: var(--font-weight-normal, 400);
|
|
211
|
-
letter-spacing: var(--font-size-small-letter-spacing, -0.115px);
|
|
212
|
-
}
|
|
213
|
-
</style>
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { ClickableProps } from './types';
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
class: className = '',
|
|
6
|
-
disabled = false,
|
|
7
|
-
children,
|
|
8
|
-
onclick,
|
|
9
|
-
onkeydown,
|
|
10
|
-
...restProps
|
|
11
|
-
}: ClickableProps = $props();
|
|
12
|
-
|
|
13
|
-
// Generate unique ID using $state for reactivity
|
|
14
|
-
let uniqueId = $state(crypto.randomUUID());
|
|
15
|
-
|
|
16
|
-
// Handle click events
|
|
17
|
-
function handleClick(event: MouseEvent) {
|
|
18
|
-
if (disabled) return;
|
|
19
|
-
onclick?.(event);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Handle keyboard events
|
|
23
|
-
function handleKeydown(event: KeyboardEvent) {
|
|
24
|
-
if (disabled) return;
|
|
25
|
-
|
|
26
|
-
// Activate on Enter or Space
|
|
27
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
28
|
-
event.preventDefault();
|
|
29
|
-
// Call the click handler directly for better test compatibility
|
|
30
|
-
handleClick(new MouseEvent('click', { bubbles: true, cancelable: true }));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
onkeydown?.(event);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Computed classes using $derived
|
|
37
|
-
let computedClasses = $derived(`clickable ${className} ${disabled ? 'disabled' : ''}`);
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
<div
|
|
41
|
-
id={uniqueId}
|
|
42
|
-
class={computedClasses}
|
|
43
|
-
role="button"
|
|
44
|
-
tabindex={disabled ? -1 : 0}
|
|
45
|
-
aria-disabled={disabled}
|
|
46
|
-
onclick={handleClick}
|
|
47
|
-
onkeydown={handleKeydown}
|
|
48
|
-
{...restProps}
|
|
49
|
-
>
|
|
50
|
-
{#if children}
|
|
51
|
-
{@render children()}
|
|
52
|
-
{/if}
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<style>
|
|
56
|
-
.clickable {
|
|
57
|
-
all: unset;
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
cursor: pointer;
|
|
62
|
-
transition: opacity 0.2s ease;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.clickable:focus-visible {
|
|
66
|
-
outline: 2px solid var(--color-focus, #007bff);
|
|
67
|
-
outline-offset: 2px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.clickable.disabled {
|
|
71
|
-
opacity: 0.6;
|
|
72
|
-
cursor: not-allowed;
|
|
73
|
-
pointer-events: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/* Make sure disabled state overrides any other cursor styles */
|
|
77
|
-
.clickable.disabled,
|
|
78
|
-
.clickable.disabled:hover,
|
|
79
|
-
.clickable.disabled:active,
|
|
80
|
-
.clickable.disabled:focus {
|
|
81
|
-
cursor: not-allowed !important;
|
|
82
|
-
pointer-events: none !important;
|
|
83
|
-
opacity: 0.6 !important;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.clickable:hover:not(.disabled) {
|
|
87
|
-
opacity: 0.8;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.clickable:active:not(.disabled) {
|
|
91
|
-
transform: translateY(1px);
|
|
92
|
-
}
|
|
93
|
-
</style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Clickable } from './Clickable.svelte';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
export interface ClickableProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
class?: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
children?: Snippet;
|
|
7
|
-
onclick?: (event: MouseEvent) => void;
|
|
8
|
-
onkeydown?: (event: KeyboardEvent) => void;
|
|
9
|
-
}
|
|
10
|
-
export interface ClickableEvents {
|
|
11
|
-
click: {
|
|
12
|
-
detail: MouseEvent;
|
|
13
|
-
};
|
|
14
|
-
keydown: {
|
|
15
|
-
detail: KeyboardEvent;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type CopyPasteComponent = {
|
|
2
|
-
meta: object;
|
|
3
|
-
type: string;
|
|
4
|
-
payload: {
|
|
5
|
-
nodes: PastedNodes[];
|
|
6
|
-
styles: PastedStyles[];
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
type PastedStyles = {
|
|
10
|
-
name: string;
|
|
11
|
-
comb: '&' | string;
|
|
12
|
-
};
|
|
13
|
-
type PastedNodes = {
|
|
14
|
-
data: {
|
|
15
|
-
xattr: Attr[];
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/ui/components/layout/{ExampleLayout.svelte.d.ts → examples/ExampleLayout.svelte.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|