kiso 0.6.6.pre → 0.7.0.pre

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37ad37d5141bb1b542e4e44cdd206772ad63c60b66d83cb24c02fb9e21fe451e
4
- data.tar.gz: 67d62e3a1879e40cb52b99e18d720c07ed7b390067c38a306230966e5bd3855f
3
+ metadata.gz: 53a2af001d842909751b3494e9fd0978a60c7cb62bf028a7a3461f195ebd6988
4
+ data.tar.gz: 5a6ce4a5958a2460be62ac17d2cc315b8e185f801c6d1801778f9b88e609cccc
5
5
  SHA512:
6
- metadata.gz: 8212fb15a724a219925764fcb5d95ef4b3eb98e261e35ede25086575f5f6ef718aea5579449477bdca4a9d340093bf671762755204f88626adcb6bb11a5d98b9
7
- data.tar.gz: e076abe507c3f6e880f63fda2fd0ece8af98457f908c2b6f92814d8e391feacde16f6761b3204ea4a21da974f1af4a9eb5fe1e79a6a80fcc3fd0986a3e1d0aa4
6
+ metadata.gz: 85ff1d9bbc10faa32d096149260d86ccb3feafa9a91673e8e8a8f9e479196166b4b244faa4d6f64db194a801ed33e25760c06b3673407038e845807b2dca1565
7
+ data.tar.gz: 86192d62578427cdf67dfc1e21028f8bf1f4accc208fdc2f65b3eb3179a780a244b40e39673fa214b9bf54b562bf466cb614ae5ca00a7f0a18846e40e84e23d4
@@ -461,13 +461,16 @@ export default class extends Controller {
461
461
  }
462
462
 
463
463
  /**
464
- * Positions the dropdown content relative to the trigger.
464
+ * Positions the dropdown content relative to the trigger using fixed
465
+ * positioning to escape ancestor overflow clipping (e.g., DashboardToolbar).
465
466
  * Starts auto-updating on scroll/resize.
466
467
  *
467
468
  * @private
468
469
  */
469
470
  _positionContent() {
470
- this._cleanupPosition = startPositioning(this.triggerTarget, this.contentTarget)
471
+ this._cleanupPosition = startPositioning(this.triggerTarget, this.contentTarget, {
472
+ strategy: "fixed",
473
+ })
471
474
  }
472
475
 
473
476
  /**
@@ -0,0 +1,45 @@
1
+ <%# locals: (icon:, size: :sm, title: nil, href: nil, method: nil, disabled: false, css_classes: "", **component_options) %>
2
+ <%# Inline icon-only action trigger. Polymorphic tag: <button> by default,
3
+ <a> with href:, or button_to with href: + method: (non-GET).
4
+ No fixed height — flows inline with surrounding text. %>
5
+ <%
6
+ css = Kiso::Themes::ActionIcon.render(size: size, class: css_classes)
7
+ label = title || t("kiso.action_icon.action")
8
+ data = kiso_prepare_options(component_options, slot: "action-icon")
9
+ use_button_to = href.present? && method.present? && method.to_s != "get"
10
+ %>
11
+ <% if use_button_to %>
12
+ <%= button_to href,
13
+ method: method,
14
+ class: css,
15
+ form_class: "contents",
16
+ data: data,
17
+ disabled: disabled || nil,
18
+ title: title,
19
+ aria: { label: label },
20
+ **component_options do %>
21
+ <%= kiso_icon(icon) %>
22
+ <% end %>
23
+ <% elsif href.present? %>
24
+ <% component_options[:href] = href
25
+ component_options[:"aria-disabled"] = true if disabled %>
26
+ <%= content_tag :a,
27
+ class: css,
28
+ data: data,
29
+ title: title,
30
+ aria: { label: label },
31
+ **component_options do %>
32
+ <%= kiso_icon(icon) %>
33
+ <% end %>
34
+ <% else %>
35
+ <%= content_tag :button,
36
+ class: css,
37
+ data: data,
38
+ type: "button",
39
+ disabled: disabled || nil,
40
+ title: title,
41
+ aria: { label: label },
42
+ **component_options do %>
43
+ <%= kiso_icon(icon) %>
44
+ <% end %>
45
+ <% end %>
@@ -1,5 +1,7 @@
1
1
  en:
2
2
  kiso:
3
+ action_icon:
4
+ action: "Action"
3
5
  alert:
4
6
  dismiss: "Dismiss"
5
7
  breadcrumb:
@@ -10,6 +10,9 @@ module Kiso
10
10
  # - Checkbox — uses rounded-[4px] for checkmark alignment
11
11
  # - Shared::CHECKABLE_ITEM — uses rounded-sm for menu items (structural)
12
12
  ROUNDED = {
13
+ # ActionIcon: rounded-md → rounded-full
14
+ action_icon: {base: "rounded-full"},
15
+
13
16
  # Buttons: rounded-md → rounded-full (pill shape)
14
17
  button: {
15
18
  variants: {
@@ -5,6 +5,9 @@ module Kiso
5
5
  # No border-radius anywhere — geometric, brutalist aesthetic.
6
6
  # Applies rounded-none to every component that has border-radius.
7
7
  SHARP = {
8
+ # ActionIcon: rounded-md → rounded-none
9
+ action_icon: {base: "rounded-none"},
10
+
8
11
  # Buttons: rounded-md → rounded-none
9
12
  button: {
10
13
  variants: {
@@ -0,0 +1,38 @@
1
+ module Kiso
2
+ module Themes
3
+ # Inline icon-only action trigger for table cells, card headers,
4
+ # and text rows.
5
+ #
6
+ # Quiet by default — muted foreground that brightens on hover with
7
+ # a subtle background. No fixed height; flows inline with
8
+ # surrounding text.
9
+ #
10
+ # @example
11
+ # ActionIcon.render(size: :sm)
12
+ #
13
+ # Variants:
14
+ # - +size+ — :xs, :sm (default), :md
15
+ #
16
+ # shadcn base: n/a (no shadcn equivalent — inspired by Mantine ActionIcon
17
+ # and Outport's appui(:icon_action))
18
+ ActionIcon = ClassVariants.build(
19
+ base: "inline-flex items-center justify-center " \
20
+ "text-muted-foreground hover:text-foreground " \
21
+ "hover:bg-accent rounded-md " \
22
+ "cursor-pointer transition-colors duration-150 " \
23
+ "disabled:pointer-events-none disabled:opacity-50 " \
24
+ "aria-disabled:cursor-not-allowed aria-disabled:opacity-50 " \
25
+ "focus-visible:outline-2 focus-visible:outline-offset-2 " \
26
+ "focus-visible:outline-inverted " \
27
+ "#{Shared::SVG_BASE}",
28
+ variants: {
29
+ size: {
30
+ xs: "p-0.5 [&_svg:not([class*='size-'])]:size-3",
31
+ sm: "p-1 [&_svg:not([class*='size-'])]:size-3.5",
32
+ md: "p-1.5 [&_svg:not([class*='size-'])]:size-4"
33
+ }
34
+ },
35
+ defaults: {size: :sm}
36
+ )
37
+ end
38
+ end
@@ -75,7 +75,7 @@ module Kiso
75
75
 
76
76
  # Right-aligned content area within {DashboardToolbar}.
77
77
  DashboardToolbarRight = ClassVariants.build(
78
- base: "flex items-center gap-1.5"
78
+ base: "ml-auto flex items-center gap-1.5"
79
79
  )
80
80
  end
81
81
  end
@@ -37,7 +37,7 @@ module Kiso
37
37
 
38
38
  # Flex row container for pagination items.
39
39
  PaginationContent = ClassVariants.build(
40
- base: "flex flex-row items-center gap-1"
40
+ base: "flex flex-row flex-wrap items-center justify-center gap-1"
41
41
  )
42
42
 
43
43
  # Wrapper for a single pagination element (link, ellipsis, etc.).
data/lib/kiso/version.rb CHANGED
@@ -5,5 +5,5 @@ module Kiso
5
5
  # Updated by +bin/release+.
6
6
  #
7
7
  # @return [String]
8
- VERSION = "0.6.6.pre"
8
+ VERSION = "0.7.0.pre"
9
9
  end
data/lib/kiso.rb CHANGED
@@ -11,6 +11,7 @@ require "kiso/propshaft_tailwind_stub_filter"
11
11
  require "kiso/engine"
12
12
  require "kiso/themes/shared"
13
13
  require "kiso/themes/badge"
14
+ require "kiso/themes/action_icon"
14
15
  require "kiso/themes/alert"
15
16
  require "kiso/themes/aspect_ratio"
16
17
  require "kiso/themes/button"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kiso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6.pre
4
+ version: 0.7.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Clarke
@@ -124,6 +124,7 @@ files:
124
124
  - app/javascript/kiso/utils/positioning.js
125
125
  - app/javascript/kiso/vendor/floating-ui-core.js
126
126
  - app/javascript/kiso/vendor/floating-ui-dom.js
127
+ - app/views/kiso/components/_action_icon.html.erb
127
128
  - app/views/kiso/components/_alert.html.erb
128
129
  - app/views/kiso/components/_alert_dialog.html.erb
129
130
  - app/views/kiso/components/_app.html.erb
@@ -358,6 +359,7 @@ files:
358
359
  - lib/kiso/presets/sharp.rb
359
360
  - lib/kiso/propshaft_tailwind_stub_filter.rb
360
361
  - lib/kiso/theme_overrides.rb
362
+ - lib/kiso/themes/action_icon.rb
361
363
  - lib/kiso/themes/alert.rb
362
364
  - lib/kiso/themes/alert_dialog.rb
363
365
  - lib/kiso/themes/aspect_ratio.rb