shadcn_phlexcomponents 0.1.17 → 0.1.18
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.
- checksums.yaml +4 -4
- data/app/javascript/controllers/accordion_controller.js +90 -100
- data/app/javascript/controllers/alert_dialog_controller.js +4 -4
- data/app/javascript/controllers/avatar_controller.js +11 -11
- data/app/javascript/controllers/checkbox_controller.js +26 -25
- data/app/javascript/controllers/collapsible_controller.js +36 -34
- data/app/javascript/controllers/combobox_controller.js +231 -262
- data/app/javascript/controllers/command_controller.js +184 -204
- data/app/javascript/controllers/date_picker_controller.js +257 -240
- data/app/javascript/controllers/date_range_picker_controller.js +200 -188
- data/app/javascript/controllers/dialog_controller.js +78 -78
- data/app/javascript/controllers/dropdown_menu_controller.js +208 -228
- data/app/javascript/controllers/dropdown_menu_sub_controller.js +97 -110
- data/app/javascript/controllers/form_field_controller.js +16 -16
- data/app/javascript/controllers/hover_card_controller.js +71 -68
- data/app/javascript/controllers/loading_button_controller.js +10 -10
- data/app/javascript/controllers/popover_controller.js +78 -84
- data/app/javascript/controllers/progress_controller.js +11 -11
- data/app/javascript/controllers/radio_group_controller.js +74 -74
- data/app/javascript/controllers/select_controller.js +232 -246
- data/app/javascript/controllers/sidebar_controller.js +27 -26
- data/app/javascript/controllers/sidebar_trigger_controller.js +9 -12
- data/app/javascript/controllers/slider_controller.js +74 -73
- data/app/javascript/controllers/switch_controller.js +23 -22
- data/app/javascript/controllers/tabs_controller.js +61 -60
- data/app/javascript/controllers/theme_switcher_controller.js +27 -27
- data/app/javascript/controllers/toast_container_controller.js +31 -44
- data/app/javascript/controllers/toast_controller.js +18 -18
- data/app/javascript/controllers/toggle_controller.js +17 -16
- data/app/javascript/controllers/toggle_group_controller.js +17 -16
- data/app/javascript/controllers/tooltip_controller.js +77 -74
- data/app/javascript/shadcn_phlexcomponents.js +58 -58
- data/app/javascript/utils/command.js +334 -392
- data/app/javascript/utils/floating_ui.js +108 -147
- data/app/javascript/utils/index.js +190 -253
- data/app/stylesheets/date_picker.css +1 -1
- data/app/stylesheets/shadcn_phlexcomponents.css +173 -0
- data/app/typescript/controllers/combobox_controller.ts +0 -1
- data/app/typescript/controllers/date_picker_controller.ts +25 -7
- data/app/typescript/controllers/tooltip_controller.ts +1 -1
- data/app/typescript/utils/command.ts +0 -2
- data/app/typescript/utils/floating_ui.ts +11 -20
- data/app/typescript/utils/index.ts +0 -7
- data/lib/shadcn_phlexcomponents/components/accordion.rb +1 -1
- data/lib/shadcn_phlexcomponents/components/alert_dialog.rb +6 -6
- data/lib/shadcn_phlexcomponents/components/base.rb +2 -2
- data/lib/shadcn_phlexcomponents/components/combobox.rb +13 -13
- data/lib/shadcn_phlexcomponents/components/command.rb +13 -13
- data/lib/shadcn_phlexcomponents/components/date_picker.rb +18 -12
- data/lib/shadcn_phlexcomponents/components/date_range_picker.rb +7 -3
- data/lib/shadcn_phlexcomponents/components/dialog.rb +6 -6
- data/lib/shadcn_phlexcomponents/components/sheet.rb +7 -7
- data/lib/shadcn_phlexcomponents/components/toggle.rb +1 -1
- data/lib/shadcn_phlexcomponents/version.rb +1 -1
- metadata +2 -1
@@ -19,6 +19,12 @@ import utc from 'dayjs/plugin/utc'
|
|
19
19
|
dayjs.extend(customParseFormat)
|
20
20
|
dayjs.extend(utc)
|
21
21
|
|
22
|
+
const SMALL_SCREEN_BREAKPOINT = 768
|
23
|
+
|
24
|
+
const isSmallScreen = () => {
|
25
|
+
return window.innerWidth < SMALL_SCREEN_BREAKPOINT
|
26
|
+
}
|
27
|
+
|
22
28
|
const DAYJS_FORMAT = 'YYYY-MM-DD'
|
23
29
|
|
24
30
|
const DatePickerController = class extends Controller<HTMLElement> {
|
@@ -55,7 +61,6 @@ const DatePickerController = class extends Controller<HTMLElement> {
|
|
55
61
|
declare format: string
|
56
62
|
declare mask: boolean
|
57
63
|
declare calendar: Calendar
|
58
|
-
declare isMobile: boolean
|
59
64
|
declare DOMKeydownListener: (event: KeyboardEvent) => void
|
60
65
|
declare cleanup: () => void
|
61
66
|
declare onClickDateListener: (self: Calendar) => void
|
@@ -81,9 +86,23 @@ const DatePickerController = class extends Controller<HTMLElement> {
|
|
81
86
|
}
|
82
87
|
|
83
88
|
contentContainerTargetConnected() {
|
84
|
-
|
85
|
-
|
86
|
-
|
89
|
+
if (isSmallScreen()) {
|
90
|
+
const windowHeight = window.innerHeight
|
91
|
+
const datePickerHeight = this.identifier === 'date-picker' ? 300 : 600
|
92
|
+
|
93
|
+
let topOffset = 0
|
94
|
+
|
95
|
+
if (windowHeight > datePickerHeight) {
|
96
|
+
topOffset = (windowHeight - datePickerHeight) / 2
|
97
|
+
}
|
98
|
+
|
99
|
+
Object.assign(this.contentContainerTarget.style, {
|
100
|
+
top: `${topOffset}px`,
|
101
|
+
left: '50%',
|
102
|
+
transform: 'translateX(-50%)',
|
103
|
+
pointerEvents: 'auto',
|
104
|
+
})
|
105
|
+
}
|
87
106
|
}
|
88
107
|
|
89
108
|
toggle() {
|
@@ -154,12 +173,11 @@ const DatePickerController = class extends Controller<HTMLElement> {
|
|
154
173
|
if (!this.contentTarget.dataset.width) {
|
155
174
|
const contentWidth = this.contentTarget.offsetWidth
|
156
175
|
this.contentTarget.dataset.width = `${contentWidth}`
|
157
|
-
|
158
176
|
this.contentTarget.style.maxWidth = `${contentWidth}px`
|
159
177
|
this.contentTarget.style.minWidth = `${contentWidth}px`
|
160
178
|
}
|
161
179
|
|
162
|
-
if (
|
180
|
+
if (isSmallScreen()) {
|
163
181
|
lockScroll(this.contentTarget.id)
|
164
182
|
this.overlayTarget.style.display = ''
|
165
183
|
this.overlayTarget.dataset.state = 'open'
|
@@ -206,7 +224,7 @@ const DatePickerController = class extends Controller<HTMLElement> {
|
|
206
224
|
contentContainer: this.contentContainerTarget,
|
207
225
|
})
|
208
226
|
|
209
|
-
if (
|
227
|
+
if (isSmallScreen()) {
|
210
228
|
unlockScroll(this.contentTarget.id)
|
211
229
|
this.overlayTarget.style.display = 'none'
|
212
230
|
this.overlayTarget.dataset.state = 'closed'
|
@@ -320,7 +320,6 @@ const renderRemoteResults = (
|
|
320
320
|
controller: Command | Combobox,
|
321
321
|
data: { html: string; group?: string }[],
|
322
322
|
) => {
|
323
|
-
console.log('data', data)
|
324
323
|
data.forEach((item) => {
|
325
324
|
const tempDiv = document.createElement('div')
|
326
325
|
tempDiv.innerHTML = item.html
|
@@ -391,7 +390,6 @@ const renderRemoteResults = (
|
|
391
390
|
|
392
391
|
controller.highlightItemByIndex(0)
|
393
392
|
|
394
|
-
console.log('controller.filteredItems', controller.filteredItems)
|
395
393
|
if (controller.filteredItems.length > 0) {
|
396
394
|
hideEmpty(controller)
|
397
395
|
} else {
|
@@ -8,8 +8,11 @@ import {
|
|
8
8
|
Placement,
|
9
9
|
Middleware,
|
10
10
|
arrow,
|
11
|
+
limitShift,
|
11
12
|
} from '@floating-ui/dom'
|
12
13
|
|
14
|
+
// https://github.com/radix-ui/primitives/blob/13e76f08f7afdea623aebfd3c55a7e41ae8d8078/packages/react/popper/src/popper.tsx
|
15
|
+
|
13
16
|
const OPPOSITE_SIDE = {
|
14
17
|
top: 'bottom',
|
15
18
|
right: 'left',
|
@@ -62,8 +65,14 @@ const initFloatingUi = ({
|
|
62
65
|
}
|
63
66
|
|
64
67
|
const middleware = [
|
68
|
+
offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
|
69
|
+
shift({
|
70
|
+
mainAxis: true,
|
71
|
+
crossAxis: false,
|
72
|
+
limiter: limitShift(),
|
73
|
+
}),
|
74
|
+
flip({ crossAxis: 'alignment', fallbackAxisSideDirection: 'end' }),
|
65
75
|
transformOrigin({ arrowHeight, arrowWidth }),
|
66
|
-
offset({ mainAxis: sideOffset, alignmentAxis: alignOffset }),
|
67
76
|
size({
|
68
77
|
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
69
78
|
const { width: anchorWidth, height: anchorHeight } = rects.reference
|
@@ -86,27 +95,9 @@ const initFloatingUi = ({
|
|
86
95
|
)
|
87
96
|
},
|
88
97
|
}),
|
98
|
+
arrowElement && arrow({ element: arrowElement, padding: 0 }),
|
89
99
|
]
|
90
100
|
|
91
|
-
const flipMiddleware = flip({
|
92
|
-
// Ensure we flip to the perpendicular axis if it doesn't fit
|
93
|
-
// on narrow viewports.
|
94
|
-
crossAxis: 'alignment',
|
95
|
-
fallbackAxisSideDirection: 'end', // or 'start'
|
96
|
-
})
|
97
|
-
const shiftMiddleware = shift()
|
98
|
-
|
99
|
-
// Prioritize flip over shift for edge-aligned placements only.
|
100
|
-
if (placement.includes('-')) {
|
101
|
-
middleware.push(flipMiddleware, shiftMiddleware)
|
102
|
-
} else {
|
103
|
-
middleware.push(shiftMiddleware, flipMiddleware)
|
104
|
-
}
|
105
|
-
|
106
|
-
if (arrowElement) {
|
107
|
-
middleware.push(arrow({ element: arrowElement, padding: 0 }))
|
108
|
-
}
|
109
|
-
|
110
101
|
return autoUpdate(referenceElement, floatingElement, () => {
|
111
102
|
computePosition(referenceElement, floatingElement, {
|
112
103
|
placement: placement as Placement,
|
@@ -9,13 +9,6 @@ import type { HoverCard } from '../controllers/hover_card_controller'
|
|
9
9
|
import type { Tooltip } from '../controllers/tooltip_controller'
|
10
10
|
import type { DatePicker } from '../controllers/date_picker_controller'
|
11
11
|
import type { DateRangePicker } from '../controllers/date_range_picker_controller'
|
12
|
-
import { Application } from '@hotwired/stimulus'
|
13
|
-
|
14
|
-
declare global {
|
15
|
-
interface Window {
|
16
|
-
Stimulus: Application
|
17
|
-
}
|
18
|
-
}
|
19
12
|
|
20
13
|
const ANIMATION_OUT_DELAY = 100
|
21
14
|
const ON_OPEN_FOCUS_DELAY = 100
|
@@ -50,9 +50,9 @@ module ShadcnPhlexcomponents
|
|
50
50
|
{
|
51
51
|
data: {
|
52
52
|
controller: "alert-dialog",
|
53
|
-
alert_dialog_is_open_value: @open.to_s
|
54
|
-
}
|
55
|
-
}
|
53
|
+
alert_dialog_is_open_value: @open.to_s,
|
54
|
+
},
|
55
|
+
}
|
56
56
|
end
|
57
57
|
|
58
58
|
def view_template(&)
|
@@ -79,10 +79,10 @@ module ShadcnPhlexcomponents
|
|
79
79
|
expanded: "false",
|
80
80
|
controls: "#{@aria_id}-content",
|
81
81
|
},
|
82
|
-
data: {
|
82
|
+
data: {
|
83
83
|
as_child: @as_child.to_s,
|
84
84
|
alert_dialog_target: "trigger",
|
85
|
-
action: "click->alert-dialog#open"
|
85
|
+
action: "click->alert-dialog#open",
|
86
86
|
},
|
87
87
|
}
|
88
88
|
end
|
@@ -130,7 +130,7 @@ module ShadcnPhlexcomponents
|
|
130
130
|
},
|
131
131
|
data: {
|
132
132
|
state: "closed",
|
133
|
-
alert_dialog_target: "content"
|
133
|
+
alert_dialog_target: "content",
|
134
134
|
},
|
135
135
|
}
|
136
136
|
end
|
@@ -48,8 +48,8 @@ module ShadcnPhlexcomponents
|
|
48
48
|
search_error_text: @search_error_text,
|
49
49
|
search_empty_text: @search_empty_text,
|
50
50
|
search_placeholder_text: @search_placeholder_text,
|
51
|
-
aria_id: @aria_id,
|
52
|
-
**attributes,
|
51
|
+
aria_id: @aria_id,
|
52
|
+
**attributes,
|
53
53
|
&
|
54
54
|
)
|
55
55
|
end
|
@@ -82,11 +82,11 @@ module ShadcnPhlexcomponents
|
|
82
82
|
)
|
83
83
|
|
84
84
|
ComboboxContent(
|
85
|
-
aria_id: @aria_id,
|
86
|
-
include_blank: @include_blank,
|
87
|
-
search_error_text: @search_error_text,
|
85
|
+
aria_id: @aria_id,
|
86
|
+
include_blank: @include_blank,
|
87
|
+
search_error_text: @search_error_text,
|
88
88
|
search_empty_text: @search_empty_text,
|
89
|
-
search_placeholder_text: @search_placeholder_text
|
89
|
+
search_placeholder_text: @search_placeholder_text,
|
90
90
|
) do
|
91
91
|
collection.each do |item|
|
92
92
|
value = item.public_send(value_method)
|
@@ -189,10 +189,10 @@ module ShadcnPhlexcomponents
|
|
189
189
|
)
|
190
190
|
|
191
191
|
def initialize(
|
192
|
-
include_blank: false,
|
193
|
-
side: :bottom,
|
194
|
-
align: :center,
|
195
|
-
aria_id: nil,
|
192
|
+
include_blank: false,
|
193
|
+
side: :bottom,
|
194
|
+
align: :center,
|
195
|
+
aria_id: nil,
|
196
196
|
search_error_text: nil,
|
197
197
|
search_empty_text: nil,
|
198
198
|
search_placeholder_text: nil,
|
@@ -218,7 +218,7 @@ module ShadcnPhlexcomponents
|
|
218
218
|
template do
|
219
219
|
ComboboxGroup do
|
220
220
|
ComboboxLabel { "" }
|
221
|
-
end
|
221
|
+
end
|
222
222
|
end
|
223
223
|
|
224
224
|
label(
|
@@ -253,7 +253,7 @@ module ShadcnPhlexcomponents
|
|
253
253
|
)
|
254
254
|
end
|
255
255
|
|
256
|
-
div(class: "p-1 max-h-80 overflow-y-auto", data: { combobox_target: "listContainer"})
|
256
|
+
div(class: "p-1 max-h-80 overflow-y-auto", data: { combobox_target: "listContainer" }) do
|
257
257
|
ComboboxText(target: "empty") { @search_empty_text }
|
258
258
|
ComboboxText(target: "error") { @search_error_text }
|
259
259
|
ComboboxText(target: "loading") do
|
@@ -392,7 +392,7 @@ module ShadcnPhlexcomponents
|
|
392
392
|
|
393
393
|
class ComboboxText < Base
|
394
394
|
class_variants(base: "py-6 text-center text-sm hidden")
|
395
|
-
|
395
|
+
|
396
396
|
def initialize(target:, **attributes)
|
397
397
|
@target = target
|
398
398
|
super(**attributes)
|
@@ -11,9 +11,9 @@ module ShadcnPhlexcomponents
|
|
11
11
|
]
|
12
12
|
|
13
13
|
def initialize(
|
14
|
-
open: false,
|
15
|
-
modifier_key: nil,
|
16
|
-
shortcut_key: nil,
|
14
|
+
open: false,
|
15
|
+
modifier_key: nil,
|
16
|
+
shortcut_key: nil,
|
17
17
|
search_path: nil,
|
18
18
|
search_error_text: "Something went wrong, please try again.",
|
19
19
|
search_empty_text: "No results found",
|
@@ -44,8 +44,8 @@ module ShadcnPhlexcomponents
|
|
44
44
|
search_error_text: @search_error_text,
|
45
45
|
search_empty_text: @search_empty_text,
|
46
46
|
search_placeholder_text: @search_placeholder_text,
|
47
|
-
aria_id: @aria_id,
|
48
|
-
**attributes,
|
47
|
+
aria_id: @aria_id,
|
48
|
+
**attributes,
|
49
49
|
&
|
50
50
|
)
|
51
51
|
end
|
@@ -69,8 +69,8 @@ module ShadcnPhlexcomponents
|
|
69
69
|
command_is_open_value: @open.to_s,
|
70
70
|
modifier_key: @modifier_key,
|
71
71
|
shortcut_key: @shortcut_key,
|
72
|
-
search_path: @search_path
|
73
|
-
}
|
72
|
+
search_path: @search_path,
|
73
|
+
},
|
74
74
|
}
|
75
75
|
end
|
76
76
|
|
@@ -111,7 +111,7 @@ module ShadcnPhlexcomponents
|
|
111
111
|
},
|
112
112
|
data: {
|
113
113
|
command_target: "trigger",
|
114
|
-
action: "click->command#open"
|
114
|
+
action: "click->command#open",
|
115
115
|
},
|
116
116
|
}
|
117
117
|
end
|
@@ -149,7 +149,7 @@ module ShadcnPhlexcomponents
|
|
149
149
|
search_error_text: nil,
|
150
150
|
search_empty_text: nil,
|
151
151
|
search_placeholder_text: nil,
|
152
|
-
aria_id: nil,
|
152
|
+
aria_id: nil,
|
153
153
|
**attributes
|
154
154
|
)
|
155
155
|
@search_error_text = search_error_text
|
@@ -187,7 +187,7 @@ module ShadcnPhlexcomponents
|
|
187
187
|
template do
|
188
188
|
CommandGroup do
|
189
189
|
CommandLabel { "" }
|
190
|
-
end
|
190
|
+
end
|
191
191
|
end
|
192
192
|
|
193
193
|
div(class: "text-popover-foreground flex h-full w-full flex-col overflow-hidden bg-transparent") do
|
@@ -228,7 +228,7 @@ module ShadcnPhlexcomponents
|
|
228
228
|
)
|
229
229
|
end
|
230
230
|
|
231
|
-
div(class: "mt-3 p-1 max-h-80 min-h-80 overflow-y-auto", data: { command_target: "listContainer"})
|
231
|
+
div(class: "mt-3 p-1 max-h-80 min-h-80 overflow-y-auto", data: { command_target: "listContainer" }) do
|
232
232
|
CommandText(target: "empty") { @search_empty_text }
|
233
233
|
CommandText(target: "error") { @search_error_text }
|
234
234
|
CommandText(target: "loading") do
|
@@ -291,7 +291,7 @@ module ShadcnPhlexcomponents
|
|
291
291
|
class CommandLabel < Base
|
292
292
|
class_variants(base: "text-muted-foreground text-xs px-3 pb-1 text-xs font-medium")
|
293
293
|
|
294
|
-
def initialize(
|
294
|
+
def initialize(**attributes)
|
295
295
|
super(**attributes)
|
296
296
|
end
|
297
297
|
|
@@ -327,7 +327,7 @@ module ShadcnPhlexcomponents
|
|
327
327
|
|
328
328
|
class CommandText < Base
|
329
329
|
class_variants(base: "py-6 text-center text-sm hidden")
|
330
|
-
|
330
|
+
|
331
331
|
def initialize(target:, **attributes)
|
332
332
|
@target = target
|
333
333
|
super(**attributes)
|
@@ -20,8 +20,12 @@ module ShadcnPhlexcomponents
|
|
20
20
|
@id = id
|
21
21
|
|
22
22
|
if value
|
23
|
-
|
24
|
-
|
23
|
+
value = if value.is_a?(String)
|
24
|
+
begin
|
25
|
+
Time.parse(value)
|
26
|
+
rescue
|
27
|
+
nil
|
28
|
+
end
|
25
29
|
else
|
26
30
|
value
|
27
31
|
end
|
@@ -72,14 +76,16 @@ module ShadcnPhlexcomponents
|
|
72
76
|
placeholder: @placeholder,
|
73
77
|
)
|
74
78
|
else
|
75
|
-
div(
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
79
|
+
div(
|
80
|
+
class: <<~HEREDOC,
|
81
|
+
focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]
|
82
|
+
data-[focus=true]:border-ring data-[focus=true]:ring-ring/50 data-[focus=true]:ring-[3px]
|
83
|
+
data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 flex shadow-xs transition-[color,box-shadow]
|
84
|
+
rounded-md border bg-transparent dark:bg-input/30 border-input outline-none h-9 flex items-center
|
85
|
+
aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive
|
86
|
+
HEREDOC
|
87
|
+
data: { date_picker_target: "inputContainer", disabled: @disabled },
|
88
|
+
) do
|
83
89
|
input(
|
84
90
|
id: @id,
|
85
91
|
placeholder: @placeholder || @format,
|
@@ -196,7 +202,7 @@ module ShadcnPhlexcomponents
|
|
196
202
|
def view_template(&)
|
197
203
|
div(
|
198
204
|
style: { display: "none" },
|
199
|
-
class: "fixed
|
205
|
+
class: "fixed top-0 left-0 w-max z-50",
|
200
206
|
data: { "#{stimulus_controller_name}-target" => "contentContainer" },
|
201
207
|
) do
|
202
208
|
div(**@attributes) do
|
@@ -205,4 +211,4 @@ module ShadcnPhlexcomponents
|
|
205
211
|
end
|
206
212
|
end
|
207
213
|
end
|
208
|
-
end
|
214
|
+
end
|
@@ -27,11 +27,15 @@ module ShadcnPhlexcomponents
|
|
27
27
|
if value
|
28
28
|
value = value.map do |v|
|
29
29
|
if v.is_a?(String)
|
30
|
-
|
30
|
+
begin
|
31
|
+
Time.parse(v)
|
32
|
+
rescue
|
33
|
+
nil
|
34
|
+
end
|
31
35
|
else
|
32
36
|
v
|
33
37
|
end
|
34
|
-
end
|
38
|
+
end
|
35
39
|
end
|
36
40
|
|
37
41
|
@name = name ? name[0] : nil
|
@@ -64,7 +68,7 @@ module ShadcnPhlexcomponents
|
|
64
68
|
|
65
69
|
def view_template(&)
|
66
70
|
div(**@attributes) do
|
67
|
-
overlay(
|
71
|
+
overlay("date-range-picker")
|
68
72
|
|
69
73
|
input(
|
70
74
|
type: :hidden,
|
@@ -42,15 +42,15 @@ module ShadcnPhlexcomponents
|
|
42
42
|
{
|
43
43
|
data: {
|
44
44
|
controller: "dialog",
|
45
|
-
dialog_is_open_value: @open.to_s
|
46
|
-
}
|
45
|
+
dialog_is_open_value: @open.to_s,
|
46
|
+
},
|
47
47
|
}
|
48
48
|
end
|
49
49
|
|
50
50
|
def view_template(&)
|
51
51
|
div(**@attributes) do
|
52
52
|
overlay("dialog")
|
53
|
-
|
53
|
+
|
54
54
|
yield
|
55
55
|
end
|
56
56
|
end
|
@@ -71,10 +71,10 @@ module ShadcnPhlexcomponents
|
|
71
71
|
expanded: "false",
|
72
72
|
controls: "#{@aria_id}-content",
|
73
73
|
},
|
74
|
-
data: {
|
74
|
+
data: {
|
75
75
|
as_child: @as_child.to_s,
|
76
76
|
dialog_target: "trigger",
|
77
|
-
action: "click->dialog#open"
|
77
|
+
action: "click->dialog#open",
|
78
78
|
},
|
79
79
|
}
|
80
80
|
end
|
@@ -122,7 +122,7 @@ module ShadcnPhlexcomponents
|
|
122
122
|
},
|
123
123
|
data: {
|
124
124
|
state: "closed",
|
125
|
-
dialog_target: "content"
|
125
|
+
dialog_target: "content",
|
126
126
|
},
|
127
127
|
}
|
128
128
|
end
|
@@ -42,15 +42,15 @@ module ShadcnPhlexcomponents
|
|
42
42
|
{
|
43
43
|
data: {
|
44
44
|
controller: "dialog",
|
45
|
-
dialog_is_open_value: @open.to_s
|
46
|
-
}
|
47
|
-
}
|
45
|
+
dialog_is_open_value: @open.to_s,
|
46
|
+
},
|
47
|
+
}
|
48
48
|
end
|
49
49
|
|
50
50
|
def view_template(&)
|
51
51
|
div(**@attributes) do
|
52
52
|
overlay("dialog")
|
53
|
-
|
53
|
+
|
54
54
|
yield
|
55
55
|
end
|
56
56
|
end
|
@@ -71,10 +71,10 @@ module ShadcnPhlexcomponents
|
|
71
71
|
expanded: false,
|
72
72
|
controls: "#{@aria_id}-content",
|
73
73
|
},
|
74
|
-
data: {
|
74
|
+
data: {
|
75
75
|
as_child: @as_child.to_s,
|
76
76
|
dialog_target: "trigger",
|
77
|
-
action: "click->dialog#open"
|
77
|
+
action: "click->dialog#open",
|
78
78
|
},
|
79
79
|
}
|
80
80
|
end
|
@@ -150,7 +150,7 @@ module ShadcnPhlexcomponents
|
|
150
150
|
},
|
151
151
|
data: {
|
152
152
|
state: "closed",
|
153
|
-
dialog_target: "content"
|
153
|
+
dialog_target: "content",
|
154
154
|
},
|
155
155
|
}
|
156
156
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shadcn_phlexcomponents
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Yeoh
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- app/javascript/utils/index.js
|
110
110
|
- app/stylesheets/date_picker.css
|
111
111
|
- app/stylesheets/nouislider.css
|
112
|
+
- app/stylesheets/shadcn_phlexcomponents.css
|
112
113
|
- app/stylesheets/tw-animate.css
|
113
114
|
- app/typescript/controllers/accordion_controller.ts
|
114
115
|
- app/typescript/controllers/alert_dialog_controller.ts
|