kang-components 0.1.0 → 0.2.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.
package/README.md CHANGED
@@ -74,6 +74,27 @@ const act = useAnimatedAction();
74
74
  const onClick = () => act(() => navigate('/next'));
75
75
  ```
76
76
 
77
+ ## Action-sheet primitives
78
+
79
+ CSS-first layout for a bottom-sheet "actions" panel — a vertical container, a
80
+ list, and tappable action rows with subtle press feedback. Colors stay with the
81
+ consumer: `actionSheetRow` takes the pressed-state background, so Kang carries no
82
+ theme knowledge.
83
+
84
+ ```ts
85
+ import styled from 'styled-components';
86
+ import { actionSheetContainer, actionSheetList, actionSheetRow } from 'kang-components';
87
+
88
+ const Container = styled.div`${actionSheetContainer()}`;
89
+ const List = styled.div`${actionSheetList()}`;
90
+ const Row = styled.button`
91
+ ${({ theme }) => actionSheetRow(theme.colors.surfaceVariant)}
92
+ `;
93
+ ```
94
+
95
+ Per-row content (leading icon, label, destructive tint, ripple) is the
96
+ consumer's to layer on top of the row.
97
+
77
98
  ## Build
78
99
 
79
100
  ```bash
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Action-sheet layout primitives — CSS-first, domain-free.
3
+ *
4
+ * The shared shape of a bottom-sheet "actions" panel: a vertical container, a
5
+ * list, and tappable action rows with subtle press feedback. Each helper
6
+ * returns a plain CSS string to interpolate into your styling layer.
7
+ *
8
+ * const Container = styled.div`${actionSheetContainer()}`;
9
+ * const List = styled.div`${actionSheetList()}`;
10
+ * const Row = styled.button`${actionSheetRow(theme.colors.surfaceVariant)}`;
11
+ *
12
+ * Colors stay with the consumer: `actionSheetRow` takes the pressed-state
13
+ * background so Kang carries no theme knowledge. Per-row content styling (icon
14
+ * tint, destructive text, etc.) is the consumer's to layer on.
15
+ */
16
+ /** Vertical action-sheet wrapper: column flex with standard sheet padding. */
17
+ export declare const actionSheetContainer: () => string;
18
+ /** The list of action rows. */
19
+ export declare const actionSheetList: () => string;
20
+ /**
21
+ * A single tappable action row: leading-icon + label layout with subtle press
22
+ * feedback (`pressSubtle`, with a background-color transition). Pass
23
+ * `activeBackground` to tint the pressed state; omit it to leave the pressed
24
+ * background to the consumer.
25
+ */
26
+ export declare const actionSheetRow: (activeBackground?: string) => string;
27
+ //# sourceMappingURL=action-sheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-sheet.d.ts","sourceRoot":"","sources":["../src/action-sheet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,QAAO,MAKvC,CAAC;AAEF,+BAA+B;AAC/B,eAAO,MAAM,eAAe,QAAO,MAGlC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,sBAAuB,MAAM,KAAG,MAiB1D,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Action-sheet layout primitives — CSS-first, domain-free.
3
+ *
4
+ * The shared shape of a bottom-sheet "actions" panel: a vertical container, a
5
+ * list, and tappable action rows with subtle press feedback. Each helper
6
+ * returns a plain CSS string to interpolate into your styling layer.
7
+ *
8
+ * const Container = styled.div`${actionSheetContainer()}`;
9
+ * const List = styled.div`${actionSheetList()}`;
10
+ * const Row = styled.button`${actionSheetRow(theme.colors.surfaceVariant)}`;
11
+ *
12
+ * Colors stay with the consumer: `actionSheetRow` takes the pressed-state
13
+ * background so Kang carries no theme knowledge. Per-row content styling (icon
14
+ * tint, destructive text, etc.) is the consumer's to layer on.
15
+ */
16
+ import { pressSubtle } from './press.js';
17
+ /** Vertical action-sheet wrapper: column flex with standard sheet padding. */
18
+ export const actionSheetContainer = () => `
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: 1rem;
22
+ padding: 0.5rem 0;
23
+ `;
24
+ /** The list of action rows. */
25
+ export const actionSheetList = () => `
26
+ display: flex;
27
+ flex-direction: column;
28
+ `;
29
+ /**
30
+ * A single tappable action row: leading-icon + label layout with subtle press
31
+ * feedback (`pressSubtle`, with a background-color transition). Pass
32
+ * `activeBackground` to tint the pressed state; omit it to leave the pressed
33
+ * background to the consumer.
34
+ */
35
+ export const actionSheetRow = (activeBackground) => `
36
+ position: relative;
37
+ display: flex;
38
+ align-items: center;
39
+ gap: 1rem;
40
+ padding: 1rem;
41
+ background: none;
42
+ border: none;
43
+ border-radius: 0.75rem;
44
+ cursor: pointer;
45
+ overflow: hidden;
46
+ ${pressSubtle('background-color 0.15s ease-out')}
47
+ -webkit-tap-highlight-color: transparent;
48
+ ${activeBackground ? `
49
+ &:active {
50
+ background-color: ${activeBackground};
51
+ }` : ''}
52
+ `;
53
+ //# sourceMappingURL=action-sheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-sheet.js","sourceRoot":"","sources":["../src/action-sheet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,8EAA8E;AAC9E,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAW,EAAE,CAAC;;;;;CAKjD,CAAC;AAEF,+BAA+B;AAC/B,MAAM,CAAC,MAAM,eAAe,GAAG,GAAW,EAAE,CAAC;;;CAG5C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,gBAAyB,EAAU,EAAE,CAAC;;;;;;;;;;;GAWlE,WAAW,CAAC,iCAAiC,CAAC;;EAE/C,gBAAgB,CAAC,CAAC,CAAC;;sBAEC,gBAAgB;GACnC,CAAC,CAAC,CAAC,EAAE;CACP,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { BOUNCE_CURVE, PRESS_SCALE_PRIMARY, PRESS_SCALE_SUBTLE, pressPrimary, pressSubtle, pressPrimaryScale, pressSubtleScale, } from './press.js';
2
2
  export { useAnimatedAction } from './use-animated-action.js';
3
+ export { actionSheetContainer, actionSheetList, actionSheetRow, } from './action-sheet.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,cAAc,GACd,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { BOUNCE_CURVE, PRESS_SCALE_PRIMARY, PRESS_SCALE_SUBTLE, pressPrimary, pressSubtle, pressPrimaryScale, pressSubtleScale, } from './press.js';
2
2
  export { useAnimatedAction } from './use-animated-action.js';
3
+ export { actionSheetContainer, actionSheetList, actionSheetRow, } from './action-sheet.js';
3
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,cAAc,GACd,MAAM,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kang-components",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Generic, domain-free React UI primitives (CSS-first press feedback, delayed-action hook).",
5
5
  "type": "module",
6
6
  "license": "MIT",