@cahyo-dimas/freeday 3.21.0 → 3.22.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.
@@ -0,0 +1,68 @@
1
+ /* Freeday. Action bar
2
+ *
3
+ * One to three actions pinned to the bottom of the screen, where a thumb reaches them on a phone:
4
+ * the sign-in button, approve and reject on a document, save on a long form. Before this, an app
5
+ * either put its primary action mid-page, where it scrolled away, or hand-wrote a fixed bar that
6
+ * sat on top of the bottom nav.
7
+ *
8
+ * Sticky, not fixed: the bar keeps its place in the flow, so the last row above it is never
9
+ * covered and the page needs no extra reservation. In a shell with a bottom nav it rests on top of
10
+ * the nav; anywhere else it clears the home indicator itself. */
11
+ .fdy-actionbar{
12
+ position:sticky;bottom:0;z-index:40;
13
+ display:flex;gap:var(--space-2);
14
+ padding:var(--space-3) var(--space-4);
15
+ padding-bottom:calc(var(--space-3) + env(safe-area-inset-bottom,0px));
16
+ background:var(--color-surface-raised);
17
+ backdrop-filter:var(--surface-filter);
18
+ -webkit-backdrop-filter:var(--surface-filter);
19
+ border-top:var(--bw) solid var(--color-border);
20
+ }
21
+ /* The buttons share the width; the primary action goes last, nearest the thumb. */
22
+ .fdy-actionbar > .fdy-btn{flex:1 1 0;min-width:0;}
23
+ /* Sticky is bounded by its parent, and `.fdy-app__main` has bottom padding that sits below the bar,
24
+ * so at the end of the page the bar would stop short of the edge by that padding. A negative bottom
25
+ * margin cancels it when the bar is the last child (no :has(), the support floor includes iOS 15).
26
+ * The bar may also sit one wrapper down, in a page wrapper such as `.fdy-page`. Sticky is then
27
+ * bounded by the wrapper, so the wrapper must be the last in-flow content of main and its content
28
+ * box must end where main's does: no bottom padding, border or margin of its own (`.fdy-page` has
29
+ * none). A closed dialog and the fixed bottom nav take no room in the flow, so they may follow it.
30
+ * A dialog or drawer is not a wrapper: a bar inside a modal is not offset at any depth.
31
+ * Values mirror app-shell.css: main's padding is --space-8, and --space-5 at max-width 720px. */
32
+ .fdy-app__main > .fdy-actionbar:last-child,
33
+ .fdy-app__main > :not(dialog):not(.fdy-drawer) > .fdy-actionbar:last-child{margin-bottom:calc(-1 * var(--space-8));}
34
+ @media (max-width:720px){
35
+ .fdy-app__main > .fdy-actionbar:last-child,
36
+ .fdy-app__main > :not(dialog):not(.fdy-drawer) > .fdy-actionbar:last-child{margin-bottom:calc(-1 * var(--space-5));}
37
+ /* On a phone the bar runs edge to edge, like the nav it rests on: inset by main's side padding
38
+ * it would leave a strip of scrolling content showing on either side. The same depth rule
39
+ * holds: a wrapper between main and the bar must add no side padding, border or margin. The
40
+ * landscape notch is cleared by the bar's own padding. */
41
+ .fdy-app__main > .fdy-actionbar,
42
+ .fdy-app__main > :not(dialog):not(.fdy-drawer) > .fdy-actionbar{
43
+ margin-inline:calc(-1 * var(--space-5));
44
+ padding-left:calc(var(--space-4) + env(safe-area-inset-left,0px));
45
+ padding-right:calc(var(--space-4) + env(safe-area-inset-right,0px));
46
+ }
47
+ }
48
+ /* Above the bottom nav: --fdy-bottomnav-h is declared, and obeyed, in bottomnav.css. The nav adds
49
+ * the safe-area inset itself, so the bar rests on all of it and does not add the inset twice. */
50
+ @media (max-width:720px){
51
+ .fdy-app--has-bottomnav .fdy-app__main .fdy-actionbar{
52
+ bottom:calc(var(--fdy-bottomnav-h) + env(safe-area-inset-bottom,0px));
53
+ padding-bottom:var(--space-3);
54
+ }
55
+ /* A modal or drawer is its own screen: its bar sits at its own bottom, whatever the depth. */
56
+ .fdy-app--has-bottomnav .fdy-app__main :is(dialog, .fdy-drawer) .fdy-actionbar{
57
+ bottom:0;
58
+ padding-bottom:calc(var(--space-3) + env(safe-area-inset-bottom,0px));
59
+ }
60
+ /* In the nav shell main's padding is --space-20 + inset (bottomnav.css) and the nav is
61
+ * --fdy-bottomnav-h + inset tall. What must remain below the bar is exactly the nav, so the
62
+ * bar ends on the nav at the end of the page and is not pushed up over the last row. The
63
+ * insets cancel. */
64
+ .fdy-app--has-bottomnav .fdy-app__main > .fdy-actionbar:last-child,
65
+ .fdy-app--has-bottomnav .fdy-app__main > :not(dialog):not(.fdy-drawer) > .fdy-actionbar:last-child{
66
+ margin-bottom:calc(var(--fdy-bottomnav-h) - var(--space-20));
67
+ }
68
+ }
@@ -8,8 +8,16 @@
8
8
  *
9
9
  * Deliberately NOT part of `.fdy-app`'s markup: it is `position:fixed`, so it works from
10
10
  * anywhere inside the shell's content slot, and an application that does not want one
11
- * pays nothing. `.fdy-app--has-bottomnav` on the shell is what reserves room for it. */
11
+ * pays nothing. `.fdy-app--has-bottomnav` on the shell is what reserves room for it and states
12
+ * the bar's height, `--fdy-bottomnav-h`, which the bar is sized by. */
12
13
  .fdy-bottomnav{display:none;}
14
+ /* The bar's height, stated once so anything resting on the bar (the action bar) reads the same
15
+ * number the bar is drawn with: a 44px item, the vertical padding, the top hairline. Before this
16
+ * the height was only implied, and an item's icon and label made it 0.39px taller than the sum,
17
+ * more with a taller app font. The safe-area inset is added where it is used, not here. The
18
+ * price of a stated height: with a taller app font the label may overflow into the nav's bottom
19
+ * padding instead of growing it. */
20
+ .fdy-app--has-bottomnav{--fdy-bottomnav-h:calc(2.75rem + 2 * var(--space-2) + var(--bw));}
13
21
  @media (max-width:720px){
14
22
  .fdy-bottomnav{
15
23
  display:flex;position:fixed;left:0;right:0;bottom:0;z-index:50;
@@ -23,6 +31,8 @@
23
31
  backdrop-filter:var(--surface-filter);
24
32
  -webkit-backdrop-filter:var(--surface-filter);
25
33
  border-top:var(--bw) solid var(--color-border);
34
+ box-sizing:border-box;
35
+ height:calc(var(--fdy-bottomnav-h,auto) + env(safe-area-inset-bottom,0px));
26
36
  }
27
37
  /* Room for the bar, or the last row of every list on every screen sits under it -- and
28
38
  a row you cannot scroll to is a row nobody knows is there. */
@@ -62,28 +62,39 @@
62
62
 
63
63
  "$primaries": {
64
64
  "_comment": "The primary palette axis. Each entry redefines the eight-shade `primary` ALIAS ramp under [data-primary=\"name\"], so the semantic mapping (which shade is the fill, which is hover, which is the soft wash) is written once and never per palette. `on`/`onDark` are the label ink on a primary fill; both are MEASURED, and every pair is asserted by the contrast suite. `darkShift` pulls the dark aliases one step lighter, for a hue whose 500 sits in the luminance band where neither white nor ink reaches 4.5:1.",
65
- "azure": { "ramp": "azure", "on": "{neutral.0}", "onDark": "{neutral.0}" },
66
- "sky": { "ramp": "sky", "on": "{neutral.0}", "onDark": "{neutral.950}" },
67
- "blue": { "ramp": "blue", "on": "{neutral.0}", "onDark": "{neutral.950}" },
68
- "indigo": { "ramp": "indigo", "on": "{neutral.0}", "onDark": "{neutral.950}", "darkShift": true },
69
- "violet": { "ramp": "violet", "on": "{neutral.0}", "onDark": "{neutral.950}", "darkShift": true },
70
- "purple": { "ramp": "purple", "on": "{neutral.0}", "onDark": "{neutral.950}" },
71
- "fuchsia": { "ramp": "fuchsia", "on": "{neutral.0}", "onDark": "{neutral.950}" },
72
- "pink": { "ramp": "pink", "on": "{neutral.0}", "onDark": "{neutral.950}" },
73
- "rose": { "ramp": "rose", "on": "{neutral.0}", "onDark": "{neutral.950}" },
74
- "orange": { "ramp": "orange", "on": "{neutral.950}", "onDark": "{neutral.950}" },
75
- "amber": { "ramp": "amber", "on": "{neutral.950}", "onDark": "{neutral.950}" },
76
- "yellow": { "on": "{neutral.0}", "onDark": "{neutral.950}",
65
+ "azure": { "ramp": "azure", "on": "{neutral.0}", "onDark": "{neutral.0}", "onDeep": "{neutral.0}" },
66
+ "sky": { "ramp": "sky", "on": "{neutral.0}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
67
+ "blue": { "ramp": "blue", "on": "{neutral.0}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
68
+ "indigo": { "ramp": "indigo", "on": "{neutral.0}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}", "darkShift": true },
69
+ "violet": { "ramp": "violet", "on": "{neutral.0}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}", "darkShift": true },
70
+ "purple": { "ramp": "purple", "on": "{neutral.0}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
71
+ "fuchsia": { "ramp": "fuchsia", "on": "{neutral.0}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
72
+ "pink": { "ramp": "pink", "on": "{neutral.0}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
73
+ "rose": { "ramp": "rose", "on": "{neutral.0}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
74
+ "orange": { "ramp": "orange", "on": "{neutral.950}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
75
+ "amber": { "ramp": "amber", "on": "{neutral.950}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
76
+ "yellow": { "on": "{neutral.0}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}",
77
77
  "light": { "50": "{yellow.50}", "100": "{yellow.100}", "300": "{yellow.300}", "400": "{yellow.400}", "500": "{yellow.500}", "600": "{yellow.700}", "700": "{yellow.800}", "800": "{yellow.900}" } },
78
- "lime": { "ramp": "lime", "on": "{neutral.950}", "onDark": "{neutral.950}" },
79
- "green": { "ramp": "green", "on": "{neutral.950}", "onDark": "{neutral.950}" },
80
- "emerald": { "ramp": "emerald", "on": "{neutral.950}", "onDark": "{neutral.950}" },
81
- "teal": { "ramp": "teal", "on": "{neutral.950}", "onDark": "{neutral.950}" },
82
- "cyan": { "ramp": "cyan", "on": "{neutral.950}", "onDark": "{neutral.950}" },
83
- "noir": { "on": "{neutral.0}", "onDark": "{neutral.950}",
78
+ "lime": { "ramp": "lime", "on": "{neutral.950}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
79
+ "green": { "ramp": "green", "on": "{neutral.950}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
80
+ "emerald": { "ramp": "emerald", "on": "{neutral.950}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
81
+ "teal": { "ramp": "teal", "on": "{neutral.950}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
82
+ "cyan": { "ramp": "cyan", "on": "{neutral.950}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}" },
83
+ "noir": { "on": "{neutral.0}", "onDark": "{neutral.950}", "onDeep": "{neutral.0}",
84
84
  "light": { "50": "{neutral.100}", "100": "{neutral.200}", "300": "{neutral.500}", "400": "{neutral.700}", "500": "{neutral.800}", "600": "{neutral.900}", "700": "{neutral.800}", "800": "{neutral.950}" },
85
85
  "dark": { "50": "{neutral.800}", "100": "{neutral.700}", "300": "{neutral.300}", "400": "{neutral.200}", "500": "{neutral.100}", "600": "{neutral.50}", "700": "{neutral.200}", "800": "{neutral.300}" } }
86
86
  },
87
+ "$primaryFill": {
88
+ "_comment": "Sub-axis of the palette: [data-primary-fill=\"deep\"] re-points these semantic tokens at the next shade down the alias ramp, light theme only, and swaps the label ink for each palette's measured onDeep. The soft wash and its border do not move. Dark keeps its normal values: dark fills are already lighter than the surface needs.",
89
+ "deep": {
90
+ "color-primary": "{primary.700}",
91
+ "color-primary-hover": "{primary.800}",
92
+ "color-primary-active": "{primary.800}",
93
+ "color-primary-strong": "{primary.800}",
94
+ "color-primary-rgb": "{primary.700.rgb}",
95
+ "focus-ring": "{primary.700}"
96
+ }
97
+ },
87
98
  "$neutrals": {
88
99
  "_comment": "The neutral axis. Each entry names the Tier-1 ramp the `neutral` alias points at under [data-neutral=\"name\"]. The build flattens the whole token set once per entry and emits only what differs from the default, so tints mixed over a surface and channel triples follow the neutral with no list kept here. slate is the default and emits nothing.",
89
100
  "slate": { "ramp": "slate" },
@@ -121,7 +132,7 @@
121
132
  },
122
133
  "dur": { "fast": { "$value": "120ms" }, "base": { "$value": "180ms" }, "slow": { "$value": "280ms" } },
123
134
  "ease": { "standard": { "$value": "cubic-bezier(.2,0,0,1)" }, "spring": { "$value": "cubic-bezier(.2,.8,.2,1)" } },
124
- "control": { "h": { "$value": "2.5rem", "$compact": "2rem" }, "box": { "$value": "1.15rem" }, "switch-w": { "$value": "2.4rem" }, "switch-h": { "$value": "1.35rem" } },
135
+ "control": { "h": { "$value": "2.5rem", "$compact": "2rem", "$touch": "2.75rem" }, "box": { "$value": "1.15rem" }, "switch-w": { "$value": "2.4rem" }, "switch-h": { "$value": "1.35rem" } },
125
136
  "bw": { "$value": "1px" },
126
137
 
127
138
  "color": {