@tonyarbor/components 0.2.1 → 0.6.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/dist/Avatar.d.mts +42 -0
- package/dist/Avatar.d.ts +42 -0
- package/dist/Avatar.js +158 -0
- package/dist/Avatar.js.map +1 -0
- package/dist/Avatar.mjs +7 -0
- package/dist/Avatar.mjs.map +1 -0
- package/dist/Breadcrumbs.d.mts +51 -0
- package/dist/Breadcrumbs.d.ts +51 -0
- package/dist/Breadcrumbs.js +276 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/Breadcrumbs.mjs +7 -0
- package/dist/Breadcrumbs.mjs.map +1 -0
- package/dist/ButtonSegmented.d.mts +61 -0
- package/dist/ButtonSegmented.d.ts +61 -0
- package/dist/ButtonSegmented.js +167 -0
- package/dist/ButtonSegmented.js.map +1 -0
- package/dist/ButtonSegmented.mjs +7 -0
- package/dist/ButtonSegmented.mjs.map +1 -0
- package/dist/ListRow.d.mts +72 -0
- package/dist/ListRow.d.ts +72 -0
- package/dist/ListRow.js +194 -0
- package/dist/ListRow.js.map +1 -0
- package/dist/ListRow.mjs +7 -0
- package/dist/ListRow.mjs.map +1 -0
- package/dist/ListRowMultiLine.d.mts +56 -0
- package/dist/ListRowMultiLine.d.ts +56 -0
- package/dist/ListRowMultiLine.js +182 -0
- package/dist/ListRowMultiLine.js.map +1 -0
- package/dist/ListRowMultiLine.mjs +7 -0
- package/dist/ListRowMultiLine.mjs.map +1 -0
- package/dist/Logo.d.mts +39 -0
- package/dist/Logo.d.ts +39 -0
- package/dist/Logo.js +119 -0
- package/dist/Logo.js.map +1 -0
- package/dist/Logo.mjs +7 -0
- package/dist/Logo.mjs.map +1 -0
- package/dist/SearchGlobal.d.mts +45 -0
- package/dist/SearchGlobal.d.ts +45 -0
- package/dist/SearchGlobal.js +209 -0
- package/dist/SearchGlobal.js.map +1 -0
- package/dist/SearchGlobal.mjs +7 -0
- package/dist/SearchGlobal.mjs.map +1 -0
- package/dist/SearchOnPage.d.mts +45 -0
- package/dist/SearchOnPage.d.ts +45 -0
- package/dist/SearchOnPage.js +171 -0
- package/dist/SearchOnPage.js.map +1 -0
- package/dist/SearchOnPage.mjs +7 -0
- package/dist/SearchOnPage.mjs.map +1 -0
- package/dist/Section.d.mts +57 -0
- package/dist/Section.d.ts +57 -0
- package/dist/Section.js +72 -0
- package/dist/Section.js.map +1 -0
- package/dist/Section.mjs +7 -0
- package/dist/Section.mjs.map +1 -0
- package/dist/SectionHeading.d.mts +111 -0
- package/dist/SectionHeading.d.ts +111 -0
- package/dist/SectionHeading.js +385 -0
- package/dist/SectionHeading.js.map +1 -0
- package/dist/SectionHeading.mjs +8 -0
- package/dist/SectionHeading.mjs.map +1 -0
- package/dist/SectionHeadingInteractive.d.mts +67 -0
- package/dist/SectionHeadingInteractive.d.ts +67 -0
- package/dist/SectionHeadingInteractive.js +225 -0
- package/dist/SectionHeadingInteractive.js.map +1 -0
- package/dist/SectionHeadingInteractive.mjs +7 -0
- package/dist/SectionHeadingInteractive.mjs.map +1 -0
- package/dist/SectionIcon.d.mts +35 -0
- package/dist/SectionIcon.d.ts +35 -0
- package/dist/SectionIcon.js +142 -0
- package/dist/SectionIcon.js.map +1 -0
- package/dist/SectionIcon.mjs +7 -0
- package/dist/SectionIcon.mjs.map +1 -0
- package/dist/SubSectionHeading.d.mts +75 -0
- package/dist/SubSectionHeading.d.ts +75 -0
- package/dist/SubSectionHeading.js +225 -0
- package/dist/SubSectionHeading.js.map +1 -0
- package/dist/SubSectionHeading.mjs +7 -0
- package/dist/SubSectionHeading.mjs.map +1 -0
- package/dist/SubSectionInteractive.d.mts +65 -0
- package/dist/SubSectionInteractive.d.ts +65 -0
- package/dist/SubSectionInteractive.js +211 -0
- package/dist/SubSectionInteractive.js.map +1 -0
- package/dist/SubSectionInteractive.mjs +7 -0
- package/dist/SubSectionInteractive.mjs.map +1 -0
- package/dist/chunk-7NYBJKJS.mjs +106 -0
- package/dist/chunk-7NYBJKJS.mjs.map +1 -0
- package/dist/chunk-ALLCJATI.mjs +189 -0
- package/dist/chunk-ALLCJATI.mjs.map +1 -0
- package/dist/chunk-B7RX3TPX.mjs +135 -0
- package/dist/chunk-B7RX3TPX.mjs.map +1 -0
- package/dist/chunk-F6JVEIWC.mjs +158 -0
- package/dist/chunk-F6JVEIWC.mjs.map +1 -0
- package/dist/chunk-GHATS25Y.mjs +249 -0
- package/dist/chunk-GHATS25Y.mjs.map +1 -0
- package/dist/chunk-ILLGBZ6R.mjs +131 -0
- package/dist/chunk-ILLGBZ6R.mjs.map +1 -0
- package/dist/chunk-JSG27ZZS.mjs +122 -0
- package/dist/chunk-JSG27ZZS.mjs.map +1 -0
- package/dist/chunk-NNYU4DPD.mjs +83 -0
- package/dist/chunk-NNYU4DPD.mjs.map +1 -0
- package/dist/chunk-ODKT7LGV.mjs +146 -0
- package/dist/chunk-ODKT7LGV.mjs.map +1 -0
- package/dist/chunk-RL4G7MR3.mjs +189 -0
- package/dist/chunk-RL4G7MR3.mjs.map +1 -0
- package/dist/chunk-RQP6ZGD7.mjs +240 -0
- package/dist/chunk-RQP6ZGD7.mjs.map +1 -0
- package/dist/chunk-UPBHDBAK.mjs +173 -0
- package/dist/chunk-UPBHDBAK.mjs.map +1 -0
- package/dist/chunk-X2CW5GF3.mjs +175 -0
- package/dist/chunk-X2CW5GF3.mjs.map +1 -0
- package/dist/chunk-YJ36ZZJQ.mjs +36 -0
- package/dist/chunk-YJ36ZZJQ.mjs.map +1 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +2102 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -0
- package/package.json +71 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Breadcrumbs/index.ts","../src/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["export { Breadcrumbs } from './Breadcrumbs';\nexport type { BreadcrumbsProps, BreadcrumbItem } from './Breadcrumbs';\n","import * as React from 'react';\nimport { Link, ChevronDown, MoreHorizontal } from 'lucide-react';\n\nexport interface BreadcrumbItem {\n /**\n * The label to display for this breadcrumb\n */\n label: string;\n /**\n * Optional href for the breadcrumb link\n */\n href?: string;\n /**\n * Optional click handler\n */\n onClick?: () => void;\n /**\n * Whether this breadcrumb has a dropdown menu\n */\n hasDropdown?: boolean;\n}\n\nexport interface BreadcrumbsProps {\n /**\n * Array of breadcrumb items\n */\n items: BreadcrumbItem[];\n /**\n * Callback when copy button is clicked\n */\n onCopy?: () => void;\n /**\n * Custom className\n */\n className?: string;\n /**\n * Custom style\n */\n style?: React.CSSProperties;\n /**\n * Test ID for testing\n */\n 'data-testid'?: string;\n}\n\n/**\n * Breadcrumbs component - Arbor Design System\n *\n * Navigation component showing the current page's location in the site hierarchy.\n * Automatically truncates to show first and last breadcrumb with ellipsis when more than 6 items.\n */\nexport const Breadcrumbs = React.forwardRef<HTMLDivElement, BreadcrumbsProps>(\n (\n {\n items,\n onCopy,\n className,\n style,\n 'data-testid': dataTestId,\n },\n ref\n ) => {\n const [hoveredIndex, setHoveredIndex] = React.useState<number | null>(null);\n const [focusedIndex, setFocusedIndex] = React.useState<number | null>(null);\n const [showCopyTooltip, setShowCopyTooltip] = React.useState(false);\n const [ellipsisFocused, setEllipsisFocused] = React.useState(false);\n const [ellipsisHovered, setEllipsisHovered] = React.useState(false);\n\n // Truncate breadcrumbs if more than 6 items\n const displayItems = React.useMemo(() => {\n if (items.length > 6) {\n // Show first item, ellipsis, and last item\n return [items[0], { label: '...', isEllipsis: true }, items[items.length - 1]];\n }\n return items;\n }, [items]);\n\n const handleCopy = () => {\n onCopy?.();\n // Copy the breadcrumb trail to clipboard\n const trail = items.map(item => item.label).join(' / ');\n navigator.clipboard.writeText(trail);\n };\n\n const containerStyles: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n ...style,\n };\n\n const breadcrumbItemStyles = (index: number, isActive: boolean, isEllipsis?: boolean): React.CSSProperties => {\n const isFocused = focusedIndex === index;\n\n if (isEllipsis) {\n return {\n display: 'flex',\n alignItems: 'center',\n gap: '4px',\n height: '24px',\n overflow: 'hidden',\n };\n }\n\n return {\n display: 'flex',\n alignItems: 'center',\n gap: '4px',\n height: '24px',\n overflow: 'hidden',\n backgroundColor: isFocused ? 'rgba(255, 255, 255, 0.01)' : 'transparent',\n borderRadius: '99px',\n boxShadow: isFocused ? '0px 0px 0px 3px #3cad51' : 'none',\n padding: isFocused ? '0 6px' : '0 2px',\n margin: isFocused ? '0' : '0 4px',\n cursor: isActive ? 'default' : 'pointer',\n textDecoration: 'none',\n };\n };\n\n const linkStyles = (isActive: boolean, isHovered: boolean): React.CSSProperties => ({\n fontFamily: isActive\n ? \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\"\n : \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontSize: '13px',\n fontWeight: isActive ? 600 : 400,\n color: isActive\n ? isHovered\n ? '#0e8a0e'\n : '#2f2f2f'\n : isHovered\n ? '#0e8a0e'\n : '#595959',\n lineHeight: '1.5',\n whiteSpace: 'nowrap',\n });\n\n const dividerStyles: React.CSSProperties = {\n fontFamily: \"'PT Sans', sans-serif\",\n fontSize: '14px',\n color: '#595959',\n lineHeight: 'normal',\n whiteSpace: 'nowrap',\n };\n\n const ellipsisButtonStyles: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '24px',\n height: '24px',\n borderRadius: '99px',\n border: 'none',\n background: 'transparent',\n cursor: 'pointer',\n backgroundColor: ellipsisFocused ? 'rgba(255, 255, 255, 0.01)' : ellipsisHovered ? '#efefef' : 'transparent',\n boxShadow: ellipsisFocused ? '0px 0px 0px 3px #3cad51' : 'none',\n };\n\n const copyButtonStyles: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '24px',\n height: '24px',\n borderRadius: '99px',\n border: 'none',\n background: showCopyTooltip ? '#efefef' : 'transparent',\n cursor: 'pointer',\n position: 'relative',\n };\n\n const tooltipStyles: React.CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: '50%',\n transform: 'translateX(-50%)',\n marginTop: '8px',\n backgroundColor: '#2f2f2f',\n color: 'white',\n padding: '12px',\n borderRadius: '8px',\n fontSize: '13px',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontWeight: 400,\n lineHeight: '1.5',\n whiteSpace: 'nowrap',\n boxShadow: '0px 4px 12px rgba(32, 32, 32, 0.08)',\n zIndex: 1000,\n };\n\n return (\n <div\n ref={ref}\n className={className}\n style={containerStyles}\n data-testid={dataTestId}\n >\n {displayItems.map((item, index) => {\n const isActive = index === displayItems.length - 1;\n const isEllipsis = 'isEllipsis' in item && item.isEllipsis;\n\n if (isEllipsis) {\n return (\n <React.Fragment key={`ellipsis-${index}`}>\n <button\n style={ellipsisButtonStyles}\n onFocus={() => setEllipsisFocused(true)}\n onBlur={() => setEllipsisFocused(false)}\n onMouseEnter={() => setEllipsisHovered(true)}\n onMouseLeave={() => setEllipsisHovered(false)}\n aria-label=\"More breadcrumbs\"\n >\n <MoreHorizontal\n size={12}\n color=\"#2f2f2f\"\n strokeWidth={2}\n style={{ display: 'block', flexShrink: 0 }}\n />\n </button>\n <span style={dividerStyles}> /</span>\n </React.Fragment>\n );\n }\n\n const breadcrumbItem = item as BreadcrumbItem;\n\n if (isActive) {\n // Active breadcrumb (last item) - not clickable\n return (\n <React.Fragment key={index}>\n <div\n style={breadcrumbItemStyles(index, true)}\n onMouseEnter={() => setHoveredIndex(index)}\n onMouseLeave={() => setHoveredIndex(null)}\n onFocus={() => setFocusedIndex(index)}\n onBlur={() => setFocusedIndex(null)}\n tabIndex={0}\n >\n <span style={linkStyles(true, hoveredIndex === index)}>\n {breadcrumbItem.label}\n </span>\n </div>\n {/* Copy button - appears immediately after active breadcrumb */}\n {onCopy && (\n <button\n style={copyButtonStyles}\n onClick={handleCopy}\n onMouseEnter={() => setShowCopyTooltip(true)}\n onMouseLeave={() => setShowCopyTooltip(false)}\n aria-label=\"Copy breadcrumb trail\"\n >\n <Link\n size={12}\n color=\"#2f2f2f\"\n strokeWidth={2}\n style={{ display: 'block', flexShrink: 0 }}\n />\n {showCopyTooltip && (\n <div style={tooltipStyles}>Copy breadcrumb trail</div>\n )}\n </button>\n )}\n </React.Fragment>\n );\n }\n\n // Regular breadcrumb link\n const Element = breadcrumbItem.href ? 'a' : 'button';\n return (\n <React.Fragment key={index}>\n <Element\n {...(breadcrumbItem.href ? { href: breadcrumbItem.href } : {})}\n style={{\n ...breadcrumbItemStyles(index, false),\n border: 'none',\n background: 'transparent',\n }}\n onClick={(e) => {\n if (!breadcrumbItem.href && breadcrumbItem.onClick) {\n e.preventDefault();\n breadcrumbItem.onClick();\n }\n }}\n onMouseEnter={() => setHoveredIndex(index)}\n onMouseLeave={() => setHoveredIndex(null)}\n onFocus={() => setFocusedIndex(index)}\n onBlur={() => setFocusedIndex(null)}\n >\n <span style={linkStyles(false, hoveredIndex === index)}>\n {breadcrumbItem.label}\n </span>\n {breadcrumbItem.hasDropdown && (\n <ChevronDown\n size={12}\n color={hoveredIndex === index ? '#0e8a0e' : '#595959'}\n strokeWidth={2}\n style={{ marginLeft: '2px', display: 'inline-block', flexShrink: 0 }}\n />\n )}\n </Element>\n <span style={dividerStyles}> /</span>\n </React.Fragment>\n );\n })}\n </div>\n );\n }\n);\n\nBreadcrumbs.displayName = 'Breadcrumbs';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,0BAAkD;AA2MpC;AAzJP,IAAM,cAAoB;AAAA,EAC/B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,EACjB,GACA,QACG;AACH,UAAM,CAAC,cAAc,eAAe,IAAU,eAAwB,IAAI;AAC1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CAAC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ButtonSegmentedItem {
|
|
4
|
+
/**
|
|
5
|
+
* The label text for the button
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional icon to display before the label
|
|
10
|
+
*/
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Optional value identifier for the button
|
|
14
|
+
*/
|
|
15
|
+
value?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ButtonSegmentedProps {
|
|
18
|
+
/**
|
|
19
|
+
* Array of button items (minimum 2, maximum 4)
|
|
20
|
+
*/
|
|
21
|
+
items: ButtonSegmentedItem[];
|
|
22
|
+
/**
|
|
23
|
+
* The index of the currently active button
|
|
24
|
+
* @default 0
|
|
25
|
+
*/
|
|
26
|
+
activeIndex?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Callback when a button is clicked
|
|
29
|
+
*/
|
|
30
|
+
onChange?: (index: number, item: ButtonSegmentedItem) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Additional CSS class name
|
|
33
|
+
*/
|
|
34
|
+
className?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Additional inline styles
|
|
37
|
+
*/
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* ButtonSegmented component - Arbor Design System
|
|
42
|
+
*
|
|
43
|
+
* A segmented button group where one button is always active.
|
|
44
|
+
* Supports 2-4 buttons with optional icons.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <ButtonSegmented
|
|
49
|
+
* items={[
|
|
50
|
+
* { label: 'Day' },
|
|
51
|
+
* { label: 'Week' },
|
|
52
|
+
* { label: 'Month' },
|
|
53
|
+
* ]}
|
|
54
|
+
* activeIndex={0}
|
|
55
|
+
* onChange={(index, item) => console.log(index, item)}
|
|
56
|
+
* />
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare const ButtonSegmented: React.ForwardRefExoticComponent<ButtonSegmentedProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
|
|
61
|
+
export { ButtonSegmented, type ButtonSegmentedItem, type ButtonSegmentedProps };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ButtonSegmentedItem {
|
|
4
|
+
/**
|
|
5
|
+
* The label text for the button
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional icon to display before the label
|
|
10
|
+
*/
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Optional value identifier for the button
|
|
14
|
+
*/
|
|
15
|
+
value?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ButtonSegmentedProps {
|
|
18
|
+
/**
|
|
19
|
+
* Array of button items (minimum 2, maximum 4)
|
|
20
|
+
*/
|
|
21
|
+
items: ButtonSegmentedItem[];
|
|
22
|
+
/**
|
|
23
|
+
* The index of the currently active button
|
|
24
|
+
* @default 0
|
|
25
|
+
*/
|
|
26
|
+
activeIndex?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Callback when a button is clicked
|
|
29
|
+
*/
|
|
30
|
+
onChange?: (index: number, item: ButtonSegmentedItem) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Additional CSS class name
|
|
33
|
+
*/
|
|
34
|
+
className?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Additional inline styles
|
|
37
|
+
*/
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* ButtonSegmented component - Arbor Design System
|
|
42
|
+
*
|
|
43
|
+
* A segmented button group where one button is always active.
|
|
44
|
+
* Supports 2-4 buttons with optional icons.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <ButtonSegmented
|
|
49
|
+
* items={[
|
|
50
|
+
* { label: 'Day' },
|
|
51
|
+
* { label: 'Week' },
|
|
52
|
+
* { label: 'Month' },
|
|
53
|
+
* ]}
|
|
54
|
+
* activeIndex={0}
|
|
55
|
+
* onChange={(index, item) => console.log(index, item)}
|
|
56
|
+
* />
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare const ButtonSegmented: React.ForwardRefExoticComponent<ButtonSegmentedProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
|
|
61
|
+
export { ButtonSegmented, type ButtonSegmentedItem, type ButtonSegmentedProps };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/ButtonSegmented/index.ts
|
|
31
|
+
var ButtonSegmented_exports = {};
|
|
32
|
+
__export(ButtonSegmented_exports, {
|
|
33
|
+
ButtonSegmented: () => ButtonSegmented
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(ButtonSegmented_exports);
|
|
36
|
+
|
|
37
|
+
// src/ButtonSegmented/ButtonSegmented.tsx
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_clsx = require("clsx");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var segmentedStyles = {
|
|
42
|
+
container: {
|
|
43
|
+
display: "inline-flex",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
gap: "8px",
|
|
46
|
+
padding: "8px",
|
|
47
|
+
backgroundColor: "#ffffff",
|
|
48
|
+
border: "1px solid #efefef",
|
|
49
|
+
borderRadius: "99px",
|
|
50
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
51
|
+
},
|
|
52
|
+
button: {
|
|
53
|
+
base: {
|
|
54
|
+
display: "inline-flex",
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
justifyContent: "center",
|
|
57
|
+
gap: "8px",
|
|
58
|
+
padding: "8px 16px",
|
|
59
|
+
borderRadius: "99px",
|
|
60
|
+
border: "none",
|
|
61
|
+
cursor: "pointer",
|
|
62
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
63
|
+
fontSize: "13px",
|
|
64
|
+
fontWeight: "600",
|
|
65
|
+
lineHeight: "1.5",
|
|
66
|
+
transition: "all 0.15s ease-in-out",
|
|
67
|
+
outline: "none",
|
|
68
|
+
whiteSpace: "nowrap"
|
|
69
|
+
},
|
|
70
|
+
default: {
|
|
71
|
+
backgroundColor: "transparent",
|
|
72
|
+
color: "#595959"
|
|
73
|
+
},
|
|
74
|
+
hover: {
|
|
75
|
+
backgroundColor: "#f8f8f8",
|
|
76
|
+
color: "#2f2f2f"
|
|
77
|
+
},
|
|
78
|
+
active: {
|
|
79
|
+
backgroundColor: "#0e8a0e",
|
|
80
|
+
color: "#ffffff"
|
|
81
|
+
},
|
|
82
|
+
activeHover: {
|
|
83
|
+
backgroundColor: "#005700",
|
|
84
|
+
color: "#ffffff"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var ButtonSegmented = React.forwardRef(
|
|
89
|
+
({ items, activeIndex = 0, onChange, className, style, ...props }, ref) => {
|
|
90
|
+
const [hoveredIndex, setHoveredIndex] = React.useState(null);
|
|
91
|
+
const validItems = items.slice(0, 4);
|
|
92
|
+
if (validItems.length < 2) {
|
|
93
|
+
console.warn("ButtonSegmented requires at least 2 items");
|
|
94
|
+
}
|
|
95
|
+
const hasIcons = validItems.some((item) => item.icon);
|
|
96
|
+
const handleClick = (index) => {
|
|
97
|
+
if (index !== activeIndex && onChange) {
|
|
98
|
+
onChange(index, validItems[index]);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
ref,
|
|
105
|
+
className: (0, import_clsx.clsx)("arbor-button-segmented", className),
|
|
106
|
+
style: { ...segmentedStyles.container, ...style },
|
|
107
|
+
role: "group",
|
|
108
|
+
"aria-label": "Segmented button group",
|
|
109
|
+
...props,
|
|
110
|
+
children: validItems.map((item, index) => {
|
|
111
|
+
const isActive = index === activeIndex;
|
|
112
|
+
const isHovered = hoveredIndex === index;
|
|
113
|
+
let buttonStyle = {
|
|
114
|
+
...segmentedStyles.button.base
|
|
115
|
+
};
|
|
116
|
+
if (isActive) {
|
|
117
|
+
buttonStyle = {
|
|
118
|
+
...buttonStyle,
|
|
119
|
+
...segmentedStyles.button.active,
|
|
120
|
+
...isHovered && segmentedStyles.button.activeHover
|
|
121
|
+
};
|
|
122
|
+
} else {
|
|
123
|
+
buttonStyle = {
|
|
124
|
+
...buttonStyle,
|
|
125
|
+
...segmentedStyles.button.default,
|
|
126
|
+
...isHovered && segmentedStyles.button.hover
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
130
|
+
"button",
|
|
131
|
+
{
|
|
132
|
+
type: "button",
|
|
133
|
+
style: buttonStyle,
|
|
134
|
+
onClick: () => handleClick(index),
|
|
135
|
+
onMouseEnter: () => setHoveredIndex(index),
|
|
136
|
+
onMouseLeave: () => setHoveredIndex(null),
|
|
137
|
+
"aria-pressed": isActive,
|
|
138
|
+
children: [
|
|
139
|
+
hasIcons && item.icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
|
+
"span",
|
|
141
|
+
{
|
|
142
|
+
style: {
|
|
143
|
+
display: "flex",
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
justifyContent: "center",
|
|
146
|
+
width: "16px",
|
|
147
|
+
height: "16px"
|
|
148
|
+
},
|
|
149
|
+
children: item.icon
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
item.label
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
item.value || index
|
|
156
|
+
);
|
|
157
|
+
})
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
ButtonSegmented.displayName = "ButtonSegmented";
|
|
163
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
164
|
+
0 && (module.exports = {
|
|
165
|
+
ButtonSegmented
|
|
166
|
+
});
|
|
167
|
+
//# sourceMappingURL=ButtonSegmented.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ButtonSegmented/index.ts","../src/ButtonSegmented/ButtonSegmented.tsx"],"sourcesContent":["export { ButtonSegmented } from './ButtonSegmented';\nexport type { ButtonSegmentedProps, ButtonSegmentedItem } from './ButtonSegmented';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface ButtonSegmentedItem {\n /**\n * The label text for the button\n */\n label: string;\n /**\n * Optional icon to display before the label\n */\n icon?: React.ReactNode;\n /**\n * Optional value identifier for the button\n */\n value?: string;\n}\n\nexport interface ButtonSegmentedProps {\n /**\n * Array of button items (minimum 2, maximum 4)\n */\n items: ButtonSegmentedItem[];\n /**\n * The index of the currently active button\n * @default 0\n */\n activeIndex?: number;\n /**\n * Callback when a button is clicked\n */\n onChange?: (index: number, item: ButtonSegmentedItem) => void;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Arbor Design System segmented button styles\nconst segmentedStyles = {\n container: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: '8px',\n padding: '8px',\n backgroundColor: '#ffffff',\n border: '1px solid #efefef',\n borderRadius: '99px',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n },\n button: {\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: '8px',\n padding: '8px 16px',\n borderRadius: '99px',\n border: 'none',\n cursor: 'pointer',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontSize: '13px',\n fontWeight: '600',\n lineHeight: '1.5',\n transition: 'all 0.15s ease-in-out',\n outline: 'none',\n whiteSpace: 'nowrap' as const,\n },\n default: {\n backgroundColor: 'transparent',\n color: '#595959',\n },\n hover: {\n backgroundColor: '#f8f8f8',\n color: '#2f2f2f',\n },\n active: {\n backgroundColor: '#0e8a0e',\n color: '#ffffff',\n },\n activeHover: {\n backgroundColor: '#005700',\n color: '#ffffff',\n },\n },\n};\n\n/**\n * ButtonSegmented component - Arbor Design System\n *\n * A segmented button group where one button is always active.\n * Supports 2-4 buttons with optional icons.\n *\n * @example\n * ```tsx\n * <ButtonSegmented\n * items={[\n * { label: 'Day' },\n * { label: 'Week' },\n * { label: 'Month' },\n * ]}\n * activeIndex={0}\n * onChange={(index, item) => console.log(index, item)}\n * />\n * ```\n */\nexport const ButtonSegmented = React.forwardRef<HTMLDivElement, ButtonSegmentedProps>(\n ({ items, activeIndex = 0, onChange, className, style, ...props }, ref) => {\n const [hoveredIndex, setHoveredIndex] = React.useState<number | null>(null);\n\n // Validate items count (2-4)\n const validItems = items.slice(0, 4);\n if (validItems.length < 2) {\n console.warn('ButtonSegmented requires at least 2 items');\n }\n\n // Check if any item has an icon - if so, all should have icons\n const hasIcons = validItems.some((item) => item.icon);\n\n const handleClick = (index: number) => {\n if (index !== activeIndex && onChange) {\n onChange(index, validItems[index]);\n }\n };\n\n return (\n <div\n ref={ref}\n className={clsx('arbor-button-segmented', className)}\n style={{ ...segmentedStyles.container, ...style }}\n role=\"group\"\n aria-label=\"Segmented button group\"\n {...props}\n >\n {validItems.map((item, index) => {\n const isActive = index === activeIndex;\n const isHovered = hoveredIndex === index;\n\n let buttonStyle: React.CSSProperties = {\n ...segmentedStyles.button.base,\n };\n\n if (isActive) {\n buttonStyle = {\n ...buttonStyle,\n ...segmentedStyles.button.active,\n ...(isHovered && segmentedStyles.button.activeHover),\n };\n } else {\n buttonStyle = {\n ...buttonStyle,\n ...segmentedStyles.button.default,\n ...(isHovered && segmentedStyles.button.hover),\n };\n }\n\n return (\n <button\n key={item.value || index}\n type=\"button\"\n style={buttonStyle}\n onClick={() => handleClick(index)}\n onMouseEnter={() => setHoveredIndex(index)}\n onMouseLeave={() => setHoveredIndex(null)}\n aria-pressed={isActive}\n >\n {hasIcons && item.icon && (\n <span\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '16px',\n height: '16px',\n }}\n >\n {item.icon}\n </span>\n )}\n {item.label}\n </button>\n );\n })}\n </div>\n );\n }\n);\n\nButtonSegmented.displayName = 'ButtonSegmented';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,kBAAqB;AAgKT;AAtHZ,IAAM,kBAAkB;AAAA,EACtB,WAAW;AAAA,IACT,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,SAAS;AAAA,IACT,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,KAAK;AAAA,MACL,SAAS;AAAA,MACT,cAAc;AAAA,MACd,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,IACd;AAAA,IACA,SAAS;AAAA,MACP,iBAAiB;AAAA,MACjB,OAAO;AAAA,IACT;AAAA,IACA,OAAO;AAAA,MACL,iBAAiB;AAAA,MACjB,OAAO;AAAA,IACT;AAAA,IACA,QAAQ;AAAA,MACN,iBAAiB;AAAA,MACjB,OAAO;AAAA,IACT;AAAA,IACA,aAAa;AAAA,MACX,iBAAiB;AAAA,MACjB,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAqBO,IAAM,kBAAwB;AAAA,EACnC,CAAC,EAAE,OAAO,cAAc,GAAG,UAAU,WAAW,OAAO,GA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AAC;AAAA;AAAA,oBACC,OAAO;AAAA,sBACL,SAAS;AAAA,sBACT,YAAY;AAAA,sBACZ,gBAAgB;AAAA,sBAChB,OAAO;AAAA,sBACP,QAAQ;AAAA,oBACV;AAAA,oBAEC,eAAK;AAAA;AAAA,gBACR;AAAA,gBAED,KAAK;AAAA;AAAA;AAAA,YArBD,KAAK,SAAS;AAAA,UAsBrB;AAAA,QAEJ,CAAC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,gBAAgB,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ListRowProps {
|
|
4
|
+
/**
|
|
5
|
+
* The main value/content text (required)
|
|
6
|
+
*/
|
|
7
|
+
value: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional label text displayed on the left
|
|
10
|
+
*/
|
|
11
|
+
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional note text displayed on the right (italic)
|
|
14
|
+
*/
|
|
15
|
+
note?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Show the right arrow icon - enables hover state and indicates row is clickable
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
icon?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Click handler - typically used with icon prop for navigation
|
|
23
|
+
*/
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Additional CSS class name
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Additional inline styles
|
|
31
|
+
*/
|
|
32
|
+
style?: React.CSSProperties;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* ListRow component - Arbor Design System
|
|
36
|
+
*
|
|
37
|
+
* A flexible list row component for displaying content within sections.
|
|
38
|
+
* Supports optional label, note, and icon props.
|
|
39
|
+
* Hover state is only enabled when icon is present (indicating clickable row).
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Basic row with just value
|
|
44
|
+
* <ListRow value="John Smith" />
|
|
45
|
+
*
|
|
46
|
+
* // With label
|
|
47
|
+
* <ListRow label="Name" value="John Smith" />
|
|
48
|
+
*
|
|
49
|
+
* // With label and note
|
|
50
|
+
* <ListRow label="Name" value="John Smith" note="Primary contact" />
|
|
51
|
+
*
|
|
52
|
+
* // Clickable row with icon
|
|
53
|
+
* <ListRow
|
|
54
|
+
* label="Name"
|
|
55
|
+
* value="John Smith"
|
|
56
|
+
* icon
|
|
57
|
+
* onClick={() => navigate('/user/123')}
|
|
58
|
+
* />
|
|
59
|
+
*
|
|
60
|
+
* // All props
|
|
61
|
+
* <ListRow
|
|
62
|
+
* label="Name"
|
|
63
|
+
* value="John Smith"
|
|
64
|
+
* note="View profile"
|
|
65
|
+
* icon
|
|
66
|
+
* onClick={() => navigate('/user/123')}
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare const ListRow: React.ForwardRefExoticComponent<ListRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
71
|
+
|
|
72
|
+
export { ListRow, type ListRowProps };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ListRowProps {
|
|
4
|
+
/**
|
|
5
|
+
* The main value/content text (required)
|
|
6
|
+
*/
|
|
7
|
+
value: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional label text displayed on the left
|
|
10
|
+
*/
|
|
11
|
+
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional note text displayed on the right (italic)
|
|
14
|
+
*/
|
|
15
|
+
note?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Show the right arrow icon - enables hover state and indicates row is clickable
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
icon?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Click handler - typically used with icon prop for navigation
|
|
23
|
+
*/
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Additional CSS class name
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Additional inline styles
|
|
31
|
+
*/
|
|
32
|
+
style?: React.CSSProperties;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* ListRow component - Arbor Design System
|
|
36
|
+
*
|
|
37
|
+
* A flexible list row component for displaying content within sections.
|
|
38
|
+
* Supports optional label, note, and icon props.
|
|
39
|
+
* Hover state is only enabled when icon is present (indicating clickable row).
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Basic row with just value
|
|
44
|
+
* <ListRow value="John Smith" />
|
|
45
|
+
*
|
|
46
|
+
* // With label
|
|
47
|
+
* <ListRow label="Name" value="John Smith" />
|
|
48
|
+
*
|
|
49
|
+
* // With label and note
|
|
50
|
+
* <ListRow label="Name" value="John Smith" note="Primary contact" />
|
|
51
|
+
*
|
|
52
|
+
* // Clickable row with icon
|
|
53
|
+
* <ListRow
|
|
54
|
+
* label="Name"
|
|
55
|
+
* value="John Smith"
|
|
56
|
+
* icon
|
|
57
|
+
* onClick={() => navigate('/user/123')}
|
|
58
|
+
* />
|
|
59
|
+
*
|
|
60
|
+
* // All props
|
|
61
|
+
* <ListRow
|
|
62
|
+
* label="Name"
|
|
63
|
+
* value="John Smith"
|
|
64
|
+
* note="View profile"
|
|
65
|
+
* icon
|
|
66
|
+
* onClick={() => navigate('/user/123')}
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare const ListRow: React.ForwardRefExoticComponent<ListRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
71
|
+
|
|
72
|
+
export { ListRow, type ListRowProps };
|