shadcn_phlexcomponents 0.1.16 → 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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/javascript/controllers/accordion_controller.js +90 -100
  3. data/app/javascript/controllers/alert_dialog_controller.js +4 -4
  4. data/app/javascript/controllers/avatar_controller.js +11 -11
  5. data/app/javascript/controllers/checkbox_controller.js +26 -25
  6. data/app/javascript/controllers/collapsible_controller.js +36 -34
  7. data/app/javascript/controllers/combobox_controller.js +231 -262
  8. data/app/javascript/controllers/command_controller.js +184 -204
  9. data/app/javascript/controllers/date_picker_controller.js +257 -240
  10. data/app/javascript/controllers/date_range_picker_controller.js +200 -188
  11. data/app/javascript/controllers/dialog_controller.js +78 -78
  12. data/app/javascript/controllers/dropdown_menu_controller.js +208 -228
  13. data/app/javascript/controllers/dropdown_menu_sub_controller.js +97 -110
  14. data/app/javascript/controllers/form_field_controller.js +16 -16
  15. data/app/javascript/controllers/hover_card_controller.js +71 -68
  16. data/app/javascript/controllers/loading_button_controller.js +10 -10
  17. data/app/javascript/controllers/popover_controller.js +78 -84
  18. data/app/javascript/controllers/progress_controller.js +11 -11
  19. data/app/javascript/controllers/radio_group_controller.js +74 -74
  20. data/app/javascript/controllers/select_controller.js +232 -246
  21. data/app/javascript/controllers/sidebar_controller.js +27 -26
  22. data/app/javascript/controllers/sidebar_trigger_controller.js +9 -12
  23. data/app/javascript/controllers/slider_controller.js +74 -73
  24. data/app/javascript/controllers/switch_controller.js +23 -22
  25. data/app/javascript/controllers/tabs_controller.js +61 -60
  26. data/app/javascript/controllers/theme_switcher_controller.js +27 -27
  27. data/app/javascript/controllers/toast_container_controller.js +31 -44
  28. data/app/javascript/controllers/toast_controller.js +18 -18
  29. data/app/javascript/controllers/toggle_controller.js +17 -16
  30. data/app/javascript/controllers/toggle_group_controller.js +17 -16
  31. data/app/javascript/controllers/tooltip_controller.js +77 -74
  32. data/app/javascript/shadcn_phlexcomponents.js +58 -58
  33. data/app/javascript/utils/command.js +334 -392
  34. data/app/javascript/utils/floating_ui.js +108 -147
  35. data/app/javascript/utils/index.js +190 -253
  36. data/app/stylesheets/date_picker.css +1 -1
  37. data/app/stylesheets/shadcn_phlexcomponents.css +173 -0
  38. data/app/typescript/controllers/combobox_controller.ts +0 -1
  39. data/app/typescript/controllers/date_picker_controller.ts +25 -7
  40. data/app/typescript/controllers/tooltip_controller.ts +1 -1
  41. data/app/typescript/utils/command.ts +0 -2
  42. data/app/typescript/utils/floating_ui.ts +11 -20
  43. data/app/typescript/utils/index.ts +0 -7
  44. data/lib/shadcn_phlexcomponents/components/accordion.rb +1 -1
  45. data/lib/shadcn_phlexcomponents/components/alert_dialog.rb +6 -6
  46. data/lib/shadcn_phlexcomponents/components/base.rb +2 -2
  47. data/lib/shadcn_phlexcomponents/components/combobox.rb +15 -19
  48. data/lib/shadcn_phlexcomponents/components/command.rb +13 -13
  49. data/lib/shadcn_phlexcomponents/components/date_picker.rb +18 -12
  50. data/lib/shadcn_phlexcomponents/components/date_range_picker.rb +7 -3
  51. data/lib/shadcn_phlexcomponents/components/dialog.rb +6 -6
  52. data/lib/shadcn_phlexcomponents/components/sheet.rb +7 -7
  53. data/lib/shadcn_phlexcomponents/components/toggle.rb +1 -1
  54. data/lib/shadcn_phlexcomponents/version.rb +1 -1
  55. 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
- // Datepicker is shown as a dialog on small screens
85
- const styles = window.getComputedStyle(this.contentContainerTarget)
86
- this.isMobile = styles.translate === '-50%'
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 (this.isMobile) {
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 (this.isMobile) {
227
+ if (isSmallScreen()) {
210
228
  unlockScroll(this.contentTarget.id)
211
229
  this.overlayTarget.style.display = 'none'
212
230
  this.overlayTarget.dataset.state = 'closed'
@@ -67,7 +67,7 @@ const TooltipController = class extends Controller<HTMLElement> {
67
67
  arrowElement: this.arrowTarget,
68
68
  side: this.contentTarget.dataset.side,
69
69
  align: this.contentTarget.dataset.align,
70
- sideOffset: 8,
70
+ sideOffset: 4,
71
71
  })
72
72
  } else {
73
73
  hideContent({
@@ -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
@@ -120,7 +120,7 @@ module ShadcnPhlexcomponents
120
120
  },
121
121
  data: {
122
122
  state: "closed",
123
- accordion_target: "content"
123
+ accordion_target: "content",
124
124
  },
125
125
  ) do
126
126
  div(**@attributes, &)
@@ -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
@@ -151,8 +151,8 @@ module ShadcnPhlexcomponents
151
151
  },
152
152
  data: {
153
153
  state: "closed",
154
- "#{component}-target" => "overlay"
155
- }
154
+ "#{component}-target" => "overlay",
155
+ },
156
156
  )
157
157
  end
158
158
  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
@@ -66,10 +66,6 @@ module ShadcnPhlexcomponents
66
66
  ComboboxGroup(aria_id: @aria_id, **attributes, &)
67
67
  end
68
68
 
69
- def empty(**attributes, &)
70
- ComboboxEmpty(**attributes, &)
71
- end
72
-
73
69
  def items(collection, value_method:, text_method:, disabled_items: nil, &)
74
70
  vanish(&)
75
71
 
@@ -86,11 +82,11 @@ module ShadcnPhlexcomponents
86
82
  )
87
83
 
88
84
  ComboboxContent(
89
- aria_id: @aria_id,
90
- include_blank: @include_blank,
91
- search_error_text: @search_error_text,
85
+ aria_id: @aria_id,
86
+ include_blank: @include_blank,
87
+ search_error_text: @search_error_text,
92
88
  search_empty_text: @search_empty_text,
93
- search_placeholder_text: @search_placeholder_text
89
+ search_placeholder_text: @search_placeholder_text,
94
90
  ) do
95
91
  collection.each do |item|
96
92
  value = item.public_send(value_method)
@@ -193,10 +189,10 @@ module ShadcnPhlexcomponents
193
189
  )
194
190
 
195
191
  def initialize(
196
- include_blank: false,
197
- side: :bottom,
198
- align: :center,
199
- aria_id: nil,
192
+ include_blank: false,
193
+ side: :bottom,
194
+ align: :center,
195
+ aria_id: nil,
200
196
  search_error_text: nil,
201
197
  search_empty_text: nil,
202
198
  search_placeholder_text: nil,
@@ -222,14 +218,14 @@ module ShadcnPhlexcomponents
222
218
  template do
223
219
  ComboboxGroup do
224
220
  ComboboxLabel { "" }
225
- end
221
+ end
226
222
  end
227
223
 
228
224
  label(
229
225
  class: "sr-only",
230
226
  id: "#{@aria_id}-search-label",
231
227
  for: "#{@aria_id}-search",
232
- ) { @search_placeholder }
228
+ ) { @search_placeholder_text }
233
229
 
234
230
  div(class: "flex h-9 items-center gap-2 border-b px-3") do
235
231
  icon("search", class: "size-4 shrink-0 opacity-50")
@@ -238,7 +234,7 @@ module ShadcnPhlexcomponents
238
234
  class: "placeholder:text-muted-foreground flex w-full rounded-md bg-transparent py-3 text-sm
239
235
  outline-hidden disabled:cursor-not-allowed disabled:opacity-50 h-9",
240
236
  id: "#{@aria_id}-search",
241
- placeholder: @search_placeholder,
237
+ placeholder: @search_placeholder_text,
242
238
  type: :text,
243
239
  autocomplete: "off",
244
240
  autocorrect: "off",
@@ -257,7 +253,7 @@ module ShadcnPhlexcomponents
257
253
  )
258
254
  end
259
255
 
260
- div(class: "p-1 max-h-80 overflow-y-auto", data: { combobox_target: "listContainer"}) do
256
+ div(class: "p-1 max-h-80 overflow-y-auto", data: { combobox_target: "listContainer" }) do
261
257
  ComboboxText(target: "empty") { @search_empty_text }
262
258
  ComboboxText(target: "error") { @search_error_text }
263
259
  ComboboxText(target: "loading") do
@@ -396,7 +392,7 @@ module ShadcnPhlexcomponents
396
392
 
397
393
  class ComboboxText < Base
398
394
  class_variants(base: "py-6 text-center text-sm hidden")
399
-
395
+
400
396
  def initialize(target:, **attributes)
401
397
  @target = target
402
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"}) do
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( **attributes)
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
- value = if value.is_a?(String)
24
- DateTime.parse(value) rescue nil
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(class: <<~HEREDOC,
76
- focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]
77
- data-[focus=true]:border-ring data-[focus=true]:ring-ring/50 data-[focus=true]:ring-[3px]
78
- data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 flex shadow-xs transition-[color,box-shadow]
79
- rounded-md border bg-transparent dark:bg-input/30 border-input outline-none h-9 flex items-center
80
- aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive
81
- HEREDOC
82
- data: { date_picker_target: "inputContainer", disabled: @disabled }) do
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 z-50 top-1/4 left-1/2 -translate-x-1/2 pointer-events-auto md:top-auto md:left-auto md:translate-none md:pointer-events-[unset]",
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
- DateTime.parse(v) rescue nil
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('date-range-picker')
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
@@ -42,7 +42,7 @@ module ShadcnPhlexcomponents
42
42
  data: {
43
43
  controller: "toggle",
44
44
  toggle_is_on_value: @on.to_s,
45
- action: "click->toggle#toggle"
45
+ action: "click->toggle#toggle",
46
46
  },
47
47
  }
48
48
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ShadcnPhlexcomponents
4
- VERSION = "0.1.16"
4
+ VERSION = "0.1.18"
5
5
  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.16
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