@servicetitan/anvil2 2.5.0 → 2.5.1
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @servicetitan/anvil2
|
|
2
2
|
|
|
3
|
+
## 2.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2108](https://github.com/servicetitan/hammer/pull/2108) [`e51e4d4`](https://github.com/servicetitan/hammer/commit/e51e4d43833865bb48d6bc5b14432de376e874f9) Thanks [@w-a-t-s-o-n](https://github.com/w-a-t-s-o-n)! - [List] Remove spacing between list items
|
|
8
|
+
|
|
3
9
|
## 2.5.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -3,12 +3,12 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import { c as cx } from './index-SvGbrGuT.js';
|
|
4
4
|
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-loxbyklF.js';
|
|
5
5
|
|
|
6
|
-
import './List.css';const list = "
|
|
7
|
-
const item = "
|
|
8
|
-
const unordered = "
|
|
9
|
-
const ordered = "
|
|
10
|
-
const small = "
|
|
11
|
-
const large = "
|
|
6
|
+
import './List.css';const list = "_list_10rco_2";
|
|
7
|
+
const item = "_item_10rco_15";
|
|
8
|
+
const unordered = "_unordered_10rco_36";
|
|
9
|
+
const ordered = "_ordered_10rco_39";
|
|
10
|
+
const small = "_small_10rco_44";
|
|
11
|
+
const large = "_large_10rco_47";
|
|
12
12
|
const styles = {
|
|
13
13
|
list: list,
|
|
14
14
|
item: item,
|
|
@@ -98,4 +98,4 @@ const List = Object.assign(ListElement, {
|
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
export { List as L };
|
|
101
|
-
//# sourceMappingURL=List-
|
|
101
|
+
//# sourceMappingURL=List-CtdOo1dv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List-
|
|
1
|
+
{"version":3,"file":"List-CtdOo1dv.js","sources":["../src/components/List/ListItem.tsx","../src/components/List/List.tsx"],"sourcesContent":["import { ComponentPropsWithoutRef, forwardRef, Ref } from \"react\";\n\nimport cx from \"classnames\";\nimport styles from \"./List.module.scss\";\n\n/**\n * Props for the ListItem component\n * @extends ComponentPropsWithoutRef<\"li\">\n */\nexport type ListItemProps = ComponentPropsWithoutRef<\"li\">;\n\nexport const ListItem = forwardRef<HTMLLIElement, ListItemProps>(\n (props, ref: Ref<HTMLLIElement>) => {\n const { className, children, ...rest } = props;\n\n return (\n <li\n ref={ref}\n className={cx(styles[\"item\"], className)}\n data-anv=\"list-item\"\n {...rest}\n >\n {children}\n </li>\n );\n },\n);\n\nListItem.displayName = \"ListItem\";\n","import { ComponentPropsWithoutRef, forwardRef, Ref } from \"react\";\nimport { LayoutUtilProps, Size } from \"../../types\";\nimport { useLayoutPropsUtil } from \"../../internal/hooks\";\nimport { ListItem } from \"./ListItem\";\n\nimport cx from \"classnames\";\nimport styles from \"./List.module.scss\";\n\n/** Size option for list typography */\nexport type ListSize = Extract<Size, \"small\" | \"medium\" | \"large\">;\n\n/**\n * Props for unordered list variant\n * @extends ComponentPropsWithoutRef<\"ul\">\n * @extends LayoutUtilProps\n */\nexport type UnorderedListProps = ComponentPropsWithoutRef<\"ul\"> &\n LayoutUtilProps & {\n /** Renders as unordered list (ul). Default. */\n variant?: \"unordered\";\n /** Typography size for list content. @default \"medium\" */\n size?: ListSize;\n };\n\n/**\n * Props for ordered list variant\n * @extends ComponentPropsWithoutRef<\"ol\">\n * @extends LayoutUtilProps\n */\nexport type OrderedListProps = ComponentPropsWithoutRef<\"ol\"> &\n LayoutUtilProps & {\n /** Renders as ordered list (ol). */\n variant: \"ordered\";\n /** Typography size for list content. @default \"medium\" */\n size?: ListSize;\n };\n\n/**\n * Props for the List component\n * @extends UnorderedListProps\n * @extends OrderedListProps\n */\nexport type ListProps = UnorderedListProps | OrderedListProps;\n\nconst ListElement = forwardRef<HTMLUListElement | HTMLOListElement, ListProps>(\n (props, ref: Ref<HTMLUListElement | HTMLOListElement>) => {\n const { layoutStyles, componentProps } = useLayoutPropsUtil(props);\n const {\n className,\n children,\n variant = \"unordered\",\n size = \"medium\",\n style,\n ...rest\n } = componentProps;\n\n const listClasses = cx(styles[\"list\"], className, {\n [styles[\"unordered\"]]: variant === \"unordered\",\n [styles[\"ordered\"]]: variant === \"ordered\",\n [styles[\"small\"]]: size === \"small\",\n [styles[\"large\"]]: size === \"large\",\n });\n\n const styleCombined = {\n ...style,\n ...layoutStyles,\n };\n\n if (variant === \"ordered\") {\n return (\n <ol\n ref={ref as Ref<HTMLOListElement>}\n className={listClasses}\n style={styleCombined}\n data-anv=\"list\"\n {...rest}\n >\n {children}\n </ol>\n );\n }\n\n return (\n <ul\n ref={ref as Ref<HTMLUListElement>}\n className={listClasses}\n style={styleCombined}\n data-anv=\"list\"\n {...rest}\n >\n {children}\n </ul>\n );\n },\n);\n\nListElement.displayName = \"List\";\n\n/**\n * List component for displaying ordered or unordered lists with design system styling.\n *\n * Features:\n * - Supports unordered (ul) and ordered (ol) lists via variant prop\n * - Typography size options aligned with design tokens\n * - Semantic HTML and accessible list structure\n * - Supports nested lists\n * - Layout utilities for positioning and spacing\n *\n * @example\n * <List>\n * <List.Item>First item</List.Item>\n * <List.Item>Second item</List.Item>\n * </List>\n *\n * @example\n * <List variant=\"ordered\" start={1}>\n * <List.Item>Step one</List.Item>\n * <List.Item>Step two</List.Item>\n * </List>\n */\nexport const List = Object.assign(ListElement, {\n /**\n * ListItem component for individual items within a List.\n *\n * Features:\n * - Renders as a semantic list item (li)\n * - Supports layout and styling via standard HTML attributes\n *\n * @example\n * <List.Item>Item content</List.Item>\n */\n Item: ListItem,\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAWO,MAAM,QAAA,GAAW,UAAA;AAAA,EACtB,CAAC,OAAO,GAAA,KAA4B;AAClC,IAAA,MAAM,EAAE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X,KAAA,EAAO,aAAA;AAAA,UACP,UAAA,EAAS,MAAA;AAAA,UACR,GAAG,IAAA;AAAA,UAEH;AAAA;AAAA,OACH;AAAA,IAEJ;AAEA,IAAA,uBACE,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,WAAA;AAAA,QACX,KAAA,EAAO,aAAA;AAAA,QACP,UAAA,EAAS,MAAA;AAAA,QACR,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF,CAAA;AAEA,WAAA,CAAY,WAAA,GAAc,MAAA;AAwBnB,MAAM,IAAA,GAAO,MAAA,CAAO,MAAA,CAAO,WAAA,EAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW7C,IAAA,EAAM;AACR,CAAC;;;;"}
|
package/dist/List.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@layer starter, reset, base, state, application;
|
|
2
2
|
@layer reset {
|
|
3
|
-
.
|
|
3
|
+
._list_10rco_2 {
|
|
4
4
|
all: unset;
|
|
5
5
|
font-family: var(--font-family-base, "Nunito Sans", sans-serif);
|
|
6
6
|
font-size: 100%;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
box-sizing: border-box;
|
|
14
14
|
display: block;
|
|
15
15
|
}
|
|
16
|
-
.
|
|
16
|
+
._item_10rco_15 {
|
|
17
17
|
all: unset;
|
|
18
18
|
font-family: var(--font-family-base, "Nunito Sans", sans-serif);
|
|
19
19
|
font-size: 100%;
|
|
@@ -28,40 +28,33 @@
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
@layer base {
|
|
31
|
-
.
|
|
31
|
+
._list_10rco_2 {
|
|
32
32
|
font-size: 1rem;
|
|
33
33
|
line-height: 1.5;
|
|
34
34
|
padding-inline-start: 1.5rem;
|
|
35
35
|
color: var(--foreground-color, #141414);
|
|
36
|
-
/* Same spacing above first item of a nested list as between sibling items */
|
|
37
36
|
}
|
|
38
|
-
.
|
|
39
|
-
margin-block-start: 0.5rem;
|
|
40
|
-
}
|
|
41
|
-
._list_kuptj_2 ._item_kuptj_15 ._list_kuptj_2 > ._item_kuptj_15:first-child {
|
|
42
|
-
margin-block-start: 0.5rem;
|
|
43
|
-
}
|
|
44
|
-
._list_kuptj_2._unordered_kuptj_43 {
|
|
37
|
+
._list_10rco_2._unordered_10rco_36 {
|
|
45
38
|
list-style-type: disc;
|
|
46
39
|
}
|
|
47
|
-
.
|
|
40
|
+
._list_10rco_2._ordered_10rco_39 {
|
|
48
41
|
list-style-type: decimal;
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
44
|
@layer state {
|
|
52
|
-
.
|
|
45
|
+
._list_10rco_2._small_10rco_44 {
|
|
53
46
|
font-size: 0.875rem;
|
|
54
47
|
}
|
|
55
|
-
.
|
|
48
|
+
._list_10rco_2._large_10rco_47 {
|
|
56
49
|
font-size: 1.25rem;
|
|
57
50
|
}
|
|
58
51
|
}
|
|
59
|
-
.bootstrap ul.
|
|
60
|
-
.bootstrap ol.
|
|
52
|
+
.bootstrap ul._list_10rco_2,
|
|
53
|
+
.bootstrap ol._list_10rco_2 {
|
|
61
54
|
padding: revert-layer;
|
|
62
55
|
margin: revert-layer;
|
|
63
56
|
}
|
|
64
|
-
.bootstrap ul.
|
|
65
|
-
.bootstrap ol.
|
|
57
|
+
.bootstrap ul._list_10rco_2 ._item_10rco_15,
|
|
58
|
+
.bootstrap ol._list_10rco_2 ._item_10rco_15 {
|
|
66
59
|
line-height: revert-layer;
|
|
67
60
|
}
|
package/dist/List.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { L as List, L as default } from './List-
|
|
1
|
+
export { L as List, L as default } from './List-CtdOo1dv.js';
|
|
2
2
|
//# sourceMappingURL=List.js.map
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ export { I as InputMask } from './InputMask-B7ZnJoR5.js';
|
|
|
38
38
|
export { L as Layout, a as LayoutElement, b as LayoutItem } from './Layout-DTAU7jS5.js';
|
|
39
39
|
export { L as Link, u as useLinkStyles } from './Link-B3reiL5f.js';
|
|
40
40
|
export { L as LinkButton } from './LinkButton-D62f2os3.js';
|
|
41
|
-
export { L as List } from './List-
|
|
41
|
+
export { L as List } from './List-CtdOo1dv.js';
|
|
42
42
|
import { L as Listbox } from './Listbox-DMyxIokT.js';
|
|
43
43
|
export { L as ListView, a as ListViewOption, b as ListViewOptionCell } from './ListView-CN8zu-cq.js';
|
|
44
44
|
export { M as Menu } from './Menu-CpRnsr0v.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/anvil2",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"tabbable": "^6.2.0",
|
|
60
60
|
"tinycolor2": "^1.6.0",
|
|
61
61
|
"uuid": "^10.0.0",
|
|
62
|
-
"@servicetitan/hammer-
|
|
63
|
-
"@servicetitan/hammer-
|
|
62
|
+
"@servicetitan/hammer-icon": "1.2.0",
|
|
63
|
+
"@servicetitan/hammer-token": "2.5.1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@types/react": "^18 || ^19",
|