@seed-design/lynx-css 0.11.0 → 0.12.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.
Files changed (82) hide show
  1. package/all.css +3258 -1215
  2. package/all.min.css +1 -1
  3. package/base.css +13 -3
  4. package/base.min.css +1 -1
  5. package/package.json +1 -1
  6. package/recipes/alert-dialog.css +114 -0
  7. package/recipes/alert-dialog.d.ts +24 -0
  8. package/recipes/alert-dialog.mjs +67 -0
  9. package/recipes/app-bar.css +27 -21
  10. package/recipes/attachment-input-item.css +276 -0
  11. package/recipes/attachment-input-item.d.ts +40 -0
  12. package/recipes/attachment-input-item.mjs +128 -0
  13. package/recipes/attachment-input-trigger.css +53 -0
  14. package/recipes/attachment-input-trigger.d.ts +28 -0
  15. package/recipes/attachment-input-trigger.mjs +60 -0
  16. package/recipes/attachment-input.css +31 -0
  17. package/recipes/attachment-input.d.ts +21 -0
  18. package/recipes/attachment-input.mjs +44 -0
  19. package/recipes/callout.css +61 -56
  20. package/recipes/chip-tabs.css +136 -0
  21. package/recipes/chip-tabs.d.ts +52 -0
  22. package/recipes/chip-tabs.mjs +147 -0
  23. package/recipes/contextual-floating-button.css +131 -0
  24. package/recipes/contextual-floating-button.d.ts +40 -0
  25. package/recipes/contextual-floating-button.mjs +104 -0
  26. package/recipes/dialog.css +130 -0
  27. package/recipes/dialog.d.ts +28 -0
  28. package/recipes/dialog.mjs +76 -0
  29. package/recipes/floating-action-button.css +61 -0
  30. package/recipes/floating-action-button.d.ts +36 -0
  31. package/recipes/floating-action-button.mjs +67 -0
  32. package/recipes/help-bubble.css +112 -0
  33. package/recipes/help-bubble.d.ts +36 -0
  34. package/recipes/help-bubble.mjs +96 -0
  35. package/recipes/identity-placeholder.css +11 -0
  36. package/recipes/identity-placeholder.d.ts +24 -0
  37. package/recipes/identity-placeholder.mjs +43 -0
  38. package/recipes/input-button.css +20 -1
  39. package/recipes/input-button.d.ts +1 -1
  40. package/recipes/input-button.mjs +10 -1
  41. package/recipes/list-item.css +8 -9
  42. package/recipes/list-item.d.ts +4 -0
  43. package/recipes/list-item.mjs +11 -1
  44. package/recipes/menu-item.css +16 -2
  45. package/recipes/menu-item.d.ts +1 -1
  46. package/recipes/menu-item.mjs +4 -0
  47. package/recipes/menu-sheet-item.css +26 -15
  48. package/recipes/menu-sheet-item.d.ts +1 -1
  49. package/recipes/menu-sheet-item.mjs +4 -0
  50. package/recipes/menu-sheet.css +18 -13
  51. package/recipes/page-banner.css +8 -0
  52. package/recipes/page-banner.d.ts +1 -1
  53. package/recipes/page-banner.mjs +4 -0
  54. package/recipes/quantity-picker.css +213 -0
  55. package/recipes/quantity-picker.d.ts +44 -0
  56. package/recipes/quantity-picker.mjs +102 -0
  57. package/recipes/reaction-button.css +7 -12
  58. package/recipes/reaction-button.mjs +7 -8
  59. package/recipes/scroll-fog.css +66 -0
  60. package/recipes/scroll-fog.d.ts +36 -0
  61. package/recipes/scroll-fog.mjs +78 -0
  62. package/recipes/select-item.css +105 -0
  63. package/recipes/select-item.d.ts +36 -0
  64. package/recipes/select-item.mjs +83 -0
  65. package/recipes/select-trigger.css +147 -0
  66. package/recipes/select-trigger.d.ts +44 -0
  67. package/recipes/select-trigger.mjs +90 -0
  68. package/recipes/select.css +88 -0
  69. package/recipes/select.d.ts +32 -0
  70. package/recipes/select.mjs +81 -0
  71. package/recipes/skeleton.css +41 -0
  72. package/recipes/skeleton.d.ts +36 -0
  73. package/recipes/skeleton.mjs +50 -0
  74. package/recipes/slider-marker.css +44 -0
  75. package/recipes/slider-marker.d.ts +30 -0
  76. package/recipes/slider-marker.mjs +65 -0
  77. package/recipes/slider-tick.css +14 -0
  78. package/recipes/slider-tick.d.ts +22 -0
  79. package/recipes/slider-tick.mjs +29 -0
  80. package/recipes/slider.css +140 -0
  81. package/recipes/slider.d.ts +40 -0
  82. package/recipes/slider.mjs +99 -0
@@ -0,0 +1,131 @@
1
+ .seed-contextual-floating-button__root {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: row;
5
+ align-items: center;
6
+ justify-content: center;
7
+ flex-shrink: 0;
8
+ width: fit-content;
9
+ border-radius: var(--seed-radius-full);
10
+ box-shadow: var(--seed-shadow-s3);
11
+ --size: 16px;
12
+ --thickness: 2px;
13
+ transition: background-color var(--seed-duration-color-transition) var(--seed-timing-function-easing)
14
+ }
15
+ .seed-contextual-floating-button__content {
16
+ display: flex;
17
+ flex-direction: row;
18
+ align-items: center;
19
+ justify-content: center;
20
+ opacity: 1
21
+ }
22
+ .seed-contextual-floating-button__prefixIcon {
23
+ flex-shrink: 0
24
+ }
25
+ .seed-contextual-floating-button__icon {
26
+ flex-shrink: 0
27
+ }
28
+ .seed-contextual-floating-button__loadingIndicator {
29
+ position: absolute;
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ top: 0;
34
+ right: 0;
35
+ bottom: 0;
36
+ left: 0
37
+ }
38
+ .seed-contextual-floating-button__root--variant_solid {
39
+ background: var(--seed-color-bg-neutral-inverted);
40
+ --track-color: var(--seed-color-palette-gray-700);
41
+ --range-color: var(--seed-color-fg-neutral-inverted)
42
+ }
43
+ .seed-contextual-floating-button__text--variant_solid {
44
+ color: var(--seed-color-fg-neutral-inverted)
45
+ }
46
+ .seed-contextual-floating-button__prefixIcon--variant_solid {
47
+ color: var(--seed-color-fg-neutral-inverted)
48
+ }
49
+ .seed-contextual-floating-button__icon--variant_solid {
50
+ color: var(--seed-color-fg-neutral-inverted)
51
+ }
52
+ .seed-contextual-floating-button__root--variant_layer {
53
+ background: var(--seed-color-bg-layer-floating);
54
+ --track-color: var(--seed-color-palette-gray-500);
55
+ --range-color: var(--seed-color-fg-neutral)
56
+ }
57
+ .seed-contextual-floating-button__text--variant_layer {
58
+ color: var(--seed-color-fg-neutral)
59
+ }
60
+ .seed-contextual-floating-button__prefixIcon--variant_layer {
61
+ color: var(--seed-color-fg-neutral)
62
+ }
63
+ .seed-contextual-floating-button__icon--variant_layer {
64
+ color: var(--seed-color-fg-neutral)
65
+ }
66
+ .seed-contextual-floating-button__root--layout_withText {
67
+ min-height: 36px;
68
+ padding-top: var(--seed-dimension-x2);
69
+ padding-right: var(--seed-dimension-x3_5);
70
+ padding-bottom: var(--seed-dimension-x2);
71
+ padding-left: var(--seed-dimension-x3_5)
72
+ }
73
+ .seed-contextual-floating-button__content--layout_withText {
74
+ gap: var(--seed-dimension-x1)
75
+ }
76
+ .seed-contextual-floating-button__text--layout_withText {
77
+ font-size: var(--seed-font-size-t4);
78
+ line-height: var(--seed-line-height-t4);
79
+ font-weight: var(--seed-font-weight-medium)
80
+ }
81
+ .seed-contextual-floating-button__prefixIcon--layout_withText {
82
+ width: 16px;
83
+ height: 16px
84
+ }
85
+ .seed-contextual-floating-button__root--layout_iconOnly {
86
+ width: 44px;
87
+ height: 44px
88
+ }
89
+ .seed-contextual-floating-button__icon--layout_iconOnly {
90
+ width: 22px;
91
+ height: 22px
92
+ }
93
+ .seed-contextual-floating-button__content--loading_true {
94
+ opacity: 0
95
+ }
96
+ .seed-contextual-floating-button__root--variant_solid-pressed_true {
97
+ background: var(--seed-color-bg-neutral-inverted-pressed)
98
+ }
99
+ .seed-contextual-floating-button__root--variant_layer-pressed_true {
100
+ background: var(--seed-color-bg-layer-floating-pressed)
101
+ }
102
+ .seed-contextual-floating-button__root--variant_solid-disabled_true {
103
+ background: var(--seed-color-bg-disabled)
104
+ }
105
+ .seed-contextual-floating-button__text--variant_solid-disabled_true {
106
+ color: var(--seed-color-fg-disabled)
107
+ }
108
+ .seed-contextual-floating-button__prefixIcon--variant_solid-disabled_true {
109
+ color: var(--seed-color-fg-disabled)
110
+ }
111
+ .seed-contextual-floating-button__icon--variant_solid-disabled_true {
112
+ color: var(--seed-color-fg-disabled)
113
+ }
114
+ .seed-contextual-floating-button__root--variant_layer-disabled_true {
115
+ background: var(--seed-color-bg-disabled)
116
+ }
117
+ .seed-contextual-floating-button__text--variant_layer-disabled_true {
118
+ color: var(--seed-color-fg-disabled)
119
+ }
120
+ .seed-contextual-floating-button__prefixIcon--variant_layer-disabled_true {
121
+ color: var(--seed-color-fg-disabled)
122
+ }
123
+ .seed-contextual-floating-button__icon--variant_layer-disabled_true {
124
+ color: var(--seed-color-fg-disabled)
125
+ }
126
+ .seed-contextual-floating-button__root--variant_solid-loading_true {
127
+ background: var(--seed-color-bg-neutral-inverted-pressed)
128
+ }
129
+ .seed-contextual-floating-button__root--variant_layer-loading_true {
130
+ background: var(--seed-color-bg-layer-floating-pressed)
131
+ }
@@ -0,0 +1,40 @@
1
+ declare interface ContextualFloatingButtonVariant {
2
+ /**
3
+ * @default "solid"
4
+ */
5
+ variant: "solid" | "layer";
6
+ /**
7
+ * @default "withText"
8
+ */
9
+ layout: "withText" | "iconOnly";
10
+ /**
11
+ * @default false
12
+ */
13
+ pressed: boolean;
14
+ /**
15
+ * @default false
16
+ */
17
+ disabled: boolean;
18
+ /**
19
+ * @default false
20
+ */
21
+ loading: boolean;
22
+ }
23
+
24
+ declare type ContextualFloatingButtonVariantMap = {
25
+ [key in keyof ContextualFloatingButtonVariant]: Array<ContextualFloatingButtonVariant[key]>;
26
+ };
27
+
28
+ export declare type ContextualFloatingButtonVariantProps = Partial<ContextualFloatingButtonVariant>;
29
+
30
+ export declare type ContextualFloatingButtonSlotName = "root" | "content" | "text" | "prefixIcon" | "icon" | "loadingIndicator";
31
+
32
+ export declare const contextualFloatingButtonVariantMap: ContextualFloatingButtonVariantMap;
33
+
34
+ export declare const contextualFloatingButton: ((
35
+ props?: ContextualFloatingButtonVariantProps,
36
+ ) => Record<ContextualFloatingButtonSlotName, string>) & {
37
+ splitVariantProps: <T extends ContextualFloatingButtonVariantProps>(
38
+ props: T,
39
+ ) => [ContextualFloatingButtonVariantProps, Omit<T, keyof ContextualFloatingButtonVariantProps>];
40
+ }
@@ -0,0 +1,104 @@
1
+ import './contextual-floating-button.css';
2
+ import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
3
+
4
+ const contextualFloatingButtonSlotNames = [
5
+ [
6
+ "root",
7
+ "seed-contextual-floating-button__root"
8
+ ],
9
+ [
10
+ "content",
11
+ "seed-contextual-floating-button__content"
12
+ ],
13
+ [
14
+ "text",
15
+ "seed-contextual-floating-button__text"
16
+ ],
17
+ [
18
+ "prefixIcon",
19
+ "seed-contextual-floating-button__prefixIcon"
20
+ ],
21
+ [
22
+ "icon",
23
+ "seed-contextual-floating-button__icon"
24
+ ],
25
+ [
26
+ "loadingIndicator",
27
+ "seed-contextual-floating-button__loadingIndicator"
28
+ ]
29
+ ];
30
+
31
+ const defaultVariant = {
32
+ "variant": "solid",
33
+ "layout": "withText",
34
+ "pressed": false,
35
+ "disabled": false,
36
+ "loading": false
37
+ };
38
+
39
+ const compoundVariants = [
40
+ {
41
+ "variant": "solid",
42
+ "pressed": true
43
+ },
44
+ {
45
+ "variant": "layer",
46
+ "pressed": true
47
+ },
48
+ {
49
+ "variant": "solid",
50
+ "disabled": true
51
+ },
52
+ {
53
+ "variant": "layer",
54
+ "disabled": true
55
+ },
56
+ {
57
+ "variant": "solid",
58
+ "loading": true
59
+ },
60
+ {
61
+ "variant": "layer",
62
+ "loading": true
63
+ }
64
+ ];
65
+
66
+ export const contextualFloatingButtonVariantMap = {
67
+ "variant": [
68
+ "solid",
69
+ "layer"
70
+ ],
71
+ "layout": [
72
+ "withText",
73
+ "iconOnly"
74
+ ],
75
+ "pressed": [
76
+ true,
77
+ false
78
+ ],
79
+ "disabled": [
80
+ true,
81
+ false
82
+ ],
83
+ "loading": [
84
+ true,
85
+ false
86
+ ]
87
+ };
88
+
89
+ export const contextualFloatingButtonVariantKeys = Object.keys(contextualFloatingButtonVariantMap);
90
+
91
+ export function contextualFloatingButton(props) {
92
+ return Object.fromEntries(
93
+ contextualFloatingButtonSlotNames.map(([slot, className]) => {
94
+ return [
95
+ slot,
96
+ createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
97
+ ];
98
+ }),
99
+ );
100
+ }
101
+
102
+ Object.assign(contextualFloatingButton, { splitVariantProps: (props) => splitVariantProps(props, contextualFloatingButtonVariantMap) });
103
+
104
+ // @recipe(seed): contextual-floating-button
@@ -0,0 +1,130 @@
1
+ .seed-dialog__positioner {
2
+ position: fixed;
3
+ display: flex;
4
+ justify-content: center;
5
+ align-items: center;
6
+ top: 0;
7
+ right: 0;
8
+ bottom: 0;
9
+ left: 0;
10
+ --dialog-z-index: 2;
11
+ z-index: calc(var(--dialog-z-index) + var(--layer-index, 0));
12
+ }
13
+ .seed-dialog__backdrop {
14
+ position: fixed;
15
+ top: 0;
16
+ right: 0;
17
+ bottom: 0;
18
+ left: 0;
19
+ opacity: 0;
20
+ background-color: var(--seed-color-bg-overlay);
21
+ transition-property: opacity;
22
+ z-index: calc(var(--dialog-z-index) + var(--layer-index, 0));
23
+ }
24
+ .seed-dialog__backdrop.ui-open {
25
+ opacity: 1;
26
+ transition-duration: var(--seed-duration-d2);
27
+ transition-timing-function: var(--seed-timing-function-enter);
28
+ }
29
+ .seed-dialog__backdrop.ui-closed {
30
+ opacity: 0;
31
+ transition-duration: var(--seed-duration-d2);
32
+ transition-timing-function: var(--seed-timing-function-exit);
33
+ }
34
+ .seed-dialog__content {
35
+ position: relative;
36
+ display: flex;
37
+ flex-direction: column;
38
+ flex: 0 0 auto;
39
+ box-sizing: border-box;
40
+ width: calc(0.9 * 100vw);
41
+ max-height: calc(0.8 * 100vh);
42
+ opacity: 0;
43
+ transform: scale(1.3);
44
+ z-index: calc(var(--dialog-z-index) + var(--layer-index, 0));
45
+ background-color: var(--seed-color-bg-layer-floating);
46
+ border-radius: var(--seed-radius-r5);
47
+ transition-property: opacity, transform;
48
+ }
49
+ .seed-dialog__content.ui-open {
50
+ opacity: 1;
51
+ transform: scale(1);
52
+ transition-duration: var(--seed-duration-d4);
53
+ transition-timing-function: var(--seed-timing-function-enter-expressive);
54
+ }
55
+ .seed-dialog__content.ui-entering {
56
+ animation: seed-enter var(--seed-duration-d4) var(--seed-timing-function-enter-expressive) forwards;
57
+ --seed-enter-opacity: 0;
58
+ --seed-enter-scale: 1.3;
59
+ }
60
+ .seed-dialog__content.ui-closed {
61
+ opacity: 0;
62
+ transform: scale(1);
63
+ transition-duration: var(--seed-duration-d2);
64
+ transition-timing-function: var(--seed-timing-function-exit);
65
+ }
66
+ .seed-dialog__header {
67
+ display: flex;
68
+ flex-direction: column;
69
+ flex-shrink: 0;
70
+ gap: var(--seed-dimension-x1_5);
71
+ padding-top: var(--seed-dimension-x6);
72
+ padding-right: var(--seed-dimension-x6);
73
+ padding-bottom: var(--seed-dimension-x4);
74
+ padding-left: var(--seed-dimension-x6);
75
+ }
76
+ .seed-dialog__body {
77
+ display: flex;
78
+ flex-direction: column;
79
+ flex: 1 1 auto;
80
+ min-height: 0;
81
+ overflow-y: auto;
82
+ padding-left: var(--seed-dimension-x6);
83
+ padding-right: var(--seed-dimension-x6);
84
+ }
85
+ .seed-dialog__footer {
86
+ display: flex;
87
+ flex-direction: column;
88
+ align-items: stretch;
89
+ flex-shrink: 0;
90
+ padding-top: var(--seed-dimension-x4);
91
+ padding-right: var(--seed-dimension-x6);
92
+ padding-bottom: var(--seed-dimension-x6);
93
+ padding-left: var(--seed-dimension-x6);
94
+ }
95
+ .seed-dialog__action {}
96
+ .seed-dialog__title {
97
+ color: var(--seed-color-fg-neutral);
98
+ font-size: var(--seed-font-size-t8);
99
+ line-height: var(--seed-line-height-t8);
100
+ font-weight: var(--seed-font-weight-bold);
101
+ margin: 0;
102
+ }
103
+ .seed-dialog__description {
104
+ color: var(--seed-color-fg-neutral-muted);
105
+ font-size: var(--seed-font-size-t5);
106
+ line-height: var(--seed-line-height-t5);
107
+ font-weight: var(--seed-font-weight-regular);
108
+ margin: 0;
109
+ }
110
+ .seed-dialog__backdrop--skipAnimation_true.ui-open {
111
+ transition-duration: 0s;
112
+ }
113
+ .seed-dialog__backdrop--skipAnimation_true.ui-closed {
114
+ transition-duration: 0s;
115
+ }
116
+ .seed-dialog__content--skipAnimation_true.ui-open {
117
+ transition-duration: 0s;
118
+ }
119
+ .seed-dialog__content--skipAnimation_true.ui-entering {
120
+ animation-duration: 0s;
121
+ }
122
+ .seed-dialog__content--skipAnimation_true.ui-closed {
123
+ transition-duration: 0s;
124
+ }
125
+ .seed-dialog__content--size_medium {
126
+ max-width: 480px;
127
+ }
128
+ .seed-dialog__content--size_large {
129
+ max-width: 800px;
130
+ }
@@ -0,0 +1,28 @@
1
+ declare interface DialogVariant {
2
+ /**
3
+ * @default false
4
+ */
5
+ skipAnimation: boolean;
6
+ /**
7
+ * @default "medium"
8
+ */
9
+ size: "medium" | "large";
10
+ }
11
+
12
+ declare type DialogVariantMap = {
13
+ [key in keyof DialogVariant]: Array<DialogVariant[key]>;
14
+ };
15
+
16
+ export declare type DialogVariantProps = Partial<DialogVariant>;
17
+
18
+ export declare type DialogSlotName = "positioner" | "backdrop" | "content" | "header" | "body" | "footer" | "action" | "title" | "description";
19
+
20
+ export declare const dialogVariantMap: DialogVariantMap;
21
+
22
+ export declare const dialog: ((
23
+ props?: DialogVariantProps,
24
+ ) => Record<DialogSlotName, string>) & {
25
+ splitVariantProps: <T extends DialogVariantProps>(
26
+ props: T,
27
+ ) => [DialogVariantProps, Omit<T, keyof DialogVariantProps>];
28
+ }
@@ -0,0 +1,76 @@
1
+ import './dialog.css';
2
+ import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
3
+
4
+ const dialogSlotNames = [
5
+ [
6
+ "positioner",
7
+ "seed-dialog__positioner"
8
+ ],
9
+ [
10
+ "backdrop",
11
+ "seed-dialog__backdrop"
12
+ ],
13
+ [
14
+ "content",
15
+ "seed-dialog__content"
16
+ ],
17
+ [
18
+ "header",
19
+ "seed-dialog__header"
20
+ ],
21
+ [
22
+ "body",
23
+ "seed-dialog__body"
24
+ ],
25
+ [
26
+ "footer",
27
+ "seed-dialog__footer"
28
+ ],
29
+ [
30
+ "action",
31
+ "seed-dialog__action"
32
+ ],
33
+ [
34
+ "title",
35
+ "seed-dialog__title"
36
+ ],
37
+ [
38
+ "description",
39
+ "seed-dialog__description"
40
+ ]
41
+ ];
42
+
43
+ const defaultVariant = {
44
+ "skipAnimation": false,
45
+ "size": "medium"
46
+ };
47
+
48
+ const compoundVariants = [];
49
+
50
+ export const dialogVariantMap = {
51
+ "skipAnimation": [
52
+ true,
53
+ false
54
+ ],
55
+ "size": [
56
+ "medium",
57
+ "large"
58
+ ]
59
+ };
60
+
61
+ export const dialogVariantKeys = Object.keys(dialogVariantMap);
62
+
63
+ export function dialog(props) {
64
+ return Object.fromEntries(
65
+ dialogSlotNames.map(([slot, className]) => {
66
+ return [
67
+ slot,
68
+ createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
69
+ ];
70
+ }),
71
+ );
72
+ }
73
+
74
+ Object.assign(dialog, { splitVariantProps: (props) => splitVariantProps(props, dialogVariantMap) });
75
+
76
+ // @recipe(seed): dialog
@@ -0,0 +1,61 @@
1
+ .seed-floating-action-button__root {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: row;
5
+ align-items: center;
6
+ justify-content: center;
7
+ flex-shrink: 0;
8
+ max-width: 100%;
9
+ overflow: hidden;
10
+ background-color: var(--seed-color-bg-brand-solid);
11
+ border-radius: var(--seed-radius-full);
12
+ box-shadow: var(--seed-shadow-s3);
13
+ transition: background-color var(--seed-duration-color-transition) var(--seed-timing-function-easing), width var(--seed-duration-d4) var(--seed-timing-function-easing), height var(--seed-duration-d4) var(--seed-timing-function-easing), padding-left var(--seed-duration-d4) var(--seed-timing-function-easing), padding-right var(--seed-duration-d4) var(--seed-timing-function-easing), gap var(--seed-duration-d4) var(--seed-timing-function-easing)
14
+ }
15
+ .seed-floating-action-button__icon {
16
+ flex-shrink: 0;
17
+ color: var(--seed-color-palette-static-white);
18
+ transition: width var(--seed-duration-d4) var(--seed-timing-function-easing), height var(--seed-duration-d4) var(--seed-timing-function-easing)
19
+ }
20
+ .seed-floating-action-button__label {
21
+ width: max-content;
22
+ flex-shrink: 0;
23
+ color: var(--seed-color-palette-static-white);
24
+ font-size: var(--seed-font-size-t5);
25
+ line-height: var(--seed-line-height-t5);
26
+ font-weight: var(--seed-font-weight-bold)
27
+ }
28
+ .seed-floating-action-button__root--extended_true {
29
+ width: fit-content;
30
+ height: 48px;
31
+ padding-left: var(--seed-dimension-x4_5);
32
+ padding-right: var(--seed-dimension-x4_5);
33
+ gap: var(--seed-dimension-x1)
34
+ }
35
+ .seed-floating-action-button__icon--extended_true {
36
+ width: var(--seed-dimension-x4);
37
+ height: var(--seed-dimension-x4)
38
+ }
39
+ .seed-floating-action-button__root--extended_false {
40
+ width: 56px;
41
+ height: 56px;
42
+ padding-left: 0;
43
+ padding-right: 0;
44
+ gap: 0
45
+ }
46
+ .seed-floating-action-button__icon--extended_false {
47
+ width: var(--seed-dimension-x6);
48
+ height: var(--seed-dimension-x6)
49
+ }
50
+ .seed-floating-action-button__root--pressed_true {
51
+ background-color: var(--seed-color-bg-brand-solid-pressed)
52
+ }
53
+ .seed-floating-action-button__root--transitionEnabled_false {
54
+ transition-duration: 0s
55
+ }
56
+ .seed-floating-action-button__icon--transitionEnabled_false {
57
+ transition-duration: 0s
58
+ }
59
+ .seed-floating-action-button__root--extended_true-transitionEnabled_true {
60
+ width: calc(var(--fab-label-width) + var(--seed-dimension-x4) + var(--seed-dimension-x1) + 2 * var(--seed-dimension-x4_5))
61
+ }
@@ -0,0 +1,36 @@
1
+ declare interface FloatingActionButtonVariant {
2
+ /**
3
+ * @default true
4
+ */
5
+ extended: boolean;
6
+ /**
7
+ * @default false
8
+ */
9
+ pressed: boolean;
10
+ /**
11
+ * @default false
12
+ */
13
+ disabled: boolean;
14
+ /**
15
+ * @default false
16
+ */
17
+ transitionEnabled: boolean;
18
+ }
19
+
20
+ declare type FloatingActionButtonVariantMap = {
21
+ [key in keyof FloatingActionButtonVariant]: Array<FloatingActionButtonVariant[key]>;
22
+ };
23
+
24
+ export declare type FloatingActionButtonVariantProps = Partial<FloatingActionButtonVariant>;
25
+
26
+ export declare type FloatingActionButtonSlotName = "root" | "icon" | "label";
27
+
28
+ export declare const floatingActionButtonVariantMap: FloatingActionButtonVariantMap;
29
+
30
+ export declare const floatingActionButton: ((
31
+ props?: FloatingActionButtonVariantProps,
32
+ ) => Record<FloatingActionButtonSlotName, string>) & {
33
+ splitVariantProps: <T extends FloatingActionButtonVariantProps>(
34
+ props: T,
35
+ ) => [FloatingActionButtonVariantProps, Omit<T, keyof FloatingActionButtonVariantProps>];
36
+ }
@@ -0,0 +1,67 @@
1
+ import './floating-action-button.css';
2
+ import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
3
+
4
+ const floatingActionButtonSlotNames = [
5
+ [
6
+ "root",
7
+ "seed-floating-action-button__root"
8
+ ],
9
+ [
10
+ "icon",
11
+ "seed-floating-action-button__icon"
12
+ ],
13
+ [
14
+ "label",
15
+ "seed-floating-action-button__label"
16
+ ]
17
+ ];
18
+
19
+ const defaultVariant = {
20
+ "extended": true,
21
+ "pressed": false,
22
+ "disabled": false,
23
+ "transitionEnabled": false
24
+ };
25
+
26
+ const compoundVariants = [
27
+ {
28
+ "extended": true,
29
+ "transitionEnabled": true
30
+ }
31
+ ];
32
+
33
+ export const floatingActionButtonVariantMap = {
34
+ "extended": [
35
+ true,
36
+ false
37
+ ],
38
+ "pressed": [
39
+ true,
40
+ false
41
+ ],
42
+ "disabled": [
43
+ true,
44
+ false
45
+ ],
46
+ "transitionEnabled": [
47
+ true,
48
+ false
49
+ ]
50
+ };
51
+
52
+ export const floatingActionButtonVariantKeys = Object.keys(floatingActionButtonVariantMap);
53
+
54
+ export function floatingActionButton(props) {
55
+ return Object.fromEntries(
56
+ floatingActionButtonSlotNames.map(([slot, className]) => {
57
+ return [
58
+ slot,
59
+ createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
60
+ ];
61
+ }),
62
+ );
63
+ }
64
+
65
+ Object.assign(floatingActionButton, { splitVariantProps: (props) => splitVariantProps(props, floatingActionButtonVariantMap) });
66
+
67
+ // @recipe(seed): floating-action-button