@pega/cosmos-react-core 9.0.0-build.9.1 → 9.0.0-build.9.11
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/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +4 -1
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/ThemeSwitcher.d.ts +9 -0
- package/lib/components/AppShell/ThemeSwitcher.d.ts.map +1 -0
- package/lib/components/AppShell/ThemeSwitcher.js +58 -0
- package/lib/components/AppShell/ThemeSwitcher.js.map +1 -0
- package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts +2 -0
- package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts.map +1 -0
- package/lib/components/AppShell/ThemeSwitcher.test-ids.js +3 -0
- package/lib/components/AppShell/ThemeSwitcher.test-ids.js.map +1 -0
- package/lib/components/Configuration/Configuration.d.ts +6 -0
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +5 -1
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +6 -4
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +5 -3
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +6 -4
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.js +1 -1
- package/lib/components/Dialog/InfoDialog.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +4 -2
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.utils.d.ts +1 -1
- package/lib/components/FieldGroup/FieldGroupList.utils.js +2 -2
- package/lib/components/FieldGroup/FieldGroupList.utils.js.map +1 -1
- package/lib/components/Icon/streamline-icons/mobius.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/mobius.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/mobius.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/mobius.icon.js.map +1 -0
- package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
- package/lib/components/Icon/streamlineIconNames.js +1 -0
- package/lib/components/Icon/streamlineIconNames.js.map +1 -1
- package/lib/components/MetaList/MetaList.js +1 -1
- package/lib/components/MetaList/MetaList.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +18 -1
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js +10 -0
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +3 -1
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +40 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useItemIntersection.d.ts +2 -1
- package/lib/hooks/useItemIntersection.d.ts.map +1 -1
- package/lib/hooks/useItemIntersection.js +10 -6
- package/lib/hooks/useItemIntersection.js.map +1 -1
- package/lib/hooks/useThemeMode.d.ts +10 -0
- package/lib/hooks/useThemeMode.d.ts.map +1 -0
- package/lib/hooks/useThemeMode.js +11 -0
- package/lib/hooks/useThemeMode.js.map +1 -0
- package/lib/i18n/default.d.ts +41 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +44 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +40 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/styles/animations.d.ts +9 -0
- package/lib/styles/animations.d.ts.map +1 -0
- package/lib/styles/animations.js +78 -0
- package/lib/styles/animations.js.map +1 -0
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/index.d.ts.map +1 -1
- package/lib/styles/index.js +1 -0
- package/lib/styles/index.js.map +1 -1
- package/lib/utils/getFocusables.d.ts +4 -2
- package/lib/utils/getFocusables.d.ts.map +1 -1
- package/lib/utils/getFocusables.js +9 -7
- package/lib/utils/getFocusables.js.map +1 -1
- package/lib/utils/isInstance.d.ts +4 -4
- package/lib/utils/isInstance.d.ts.map +1 -1
- package/lib/utils/isInstance.js +20 -8
- package/lib/utils/isInstance.js.map +1 -1
- package/package.json +1 -1
|
@@ -62,13 +62,13 @@ export const getFormattedListNumber = (levelIndex, depth) => {
|
|
|
62
62
|
* @returns An object containing:
|
|
63
63
|
* - `rootIndex`: The zero-based index at the root level (e.g., 0 for "1.", 1 for "2.").
|
|
64
64
|
* - `currentIndex`: The index at the latest depth (e.g., "a." or "i.").
|
|
65
|
-
* - `compoundIndex`: The full compound index (e.g., "1
|
|
65
|
+
* - `compoundIndex`: The full compound index (e.g., "1 A II").
|
|
66
66
|
*/
|
|
67
67
|
export const getIndexDetails = (indices) => {
|
|
68
68
|
const indexSegments = indices.map((levelIndex, index) => getFormattedListNumber(levelIndex, index));
|
|
69
69
|
const rootIndex = indices[0];
|
|
70
70
|
const currentIndex = `${indexSegments[indexSegments.length - 1]}.`;
|
|
71
|
-
const compoundIndex = indexSegments.join('
|
|
71
|
+
const compoundIndex = indexSegments.join(' ').toUpperCase();
|
|
72
72
|
return { rootIndex, currentIndex, compoundIndex };
|
|
73
73
|
};
|
|
74
74
|
//# sourceMappingURL=FieldGroupList.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroupList.utils.js","sourceRoot":"","sources":["../../../src/components/Field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ED,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACpB,OAAO,mBAAmB,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,cAAc,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,OAAiB,EACmD,EAAE;IACtE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,CACtD,sBAAsB,CAAC,UAAU,EAAE,KAAK,CAAC,CAC1C,CAAC;IAEF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,YAAY,GAAG,GAAG,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC;IACnE,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IAE5D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;AACpD,CAAC,CAAC","sourcesContent":["/**\n * Converts a number to a Roman numeral.\n * @param num - The number to convert.\n * @returns The Roman numeral representation.\n */\nexport const convertToRoman = (num: number) => {\n const romanMap: [string, number][] = [\n ['m', 1000],\n ['cm', 900],\n ['d', 500],\n ['cd', 400],\n ['c', 100],\n ['xc', 90],\n ['l', 50],\n ['xl', 40],\n ['x', 10],\n ['ix', 9],\n ['v', 5],\n ['iv', 4],\n ['i', 1]\n ];\n\n let result = '';\n for (const [roman, value] of romanMap) {\n while (num >= value) {\n result += roman;\n num -= value;\n }\n }\n\n return result;\n};\n\n/**\n * Converts a number to a base-26 alphabetic string (a, b, c... aa, ab, ac...).\n * @param num - The 0-based index to convert.\n * @returns The alphabetic representation.\n */\nexport const convertToAlphabetic = (num: number) => {\n let result = '';\n while (num >= 0) {\n result = String.fromCharCode((num % 26) + 97) + result;\n num = Math.floor(num / 26) - 1;\n }\n\n return result;\n};\n\n/**\n * Generates a list number based on depth and index.\n * @param levelIndex - The index of the item in the list (0-based).\n * @param depth - The depth of the list (0-based).\n * @returns The formatted list number.\n */\nexport const getFormattedListNumber = (levelIndex: number, depth: number) => {\n if (depth % 3 === 0) {\n return (levelIndex + 1).toString();\n }\n\n if (depth % 3 === 1) {\n return convertToAlphabetic(levelIndex);\n }\n\n return convertToRoman(levelIndex + 1);\n};\n\n/**\n * Generates a compound index and the current list index based on the depth and index of the current item and its ancestors.\n * @param indices - An array of indices representing the position at each depth (e.g., [0, 1, 2]).\n * @returns An object containing:\n * - `rootIndex`: The zero-based index at the root level (e.g., 0 for \"1.\", 1 for \"2.\").\n * - `currentIndex`: The index at the latest depth (e.g., \"a.\" or \"i.\").\n * - `compoundIndex`: The full compound index (e.g., \"1 A II\").\n */\nexport const getIndexDetails = (\n indices: number[]\n): { rootIndex: number; currentIndex: string; compoundIndex: string } => {\n const indexSegments = indices.map((levelIndex, index) =>\n getFormattedListNumber(levelIndex, index)\n );\n\n const rootIndex = indices[0];\n const currentIndex = `${indexSegments[indexSegments.length - 1]}.`;\n const compoundIndex = indexSegments.join(' ').toUpperCase();\n\n return { rootIndex, currentIndex, compoundIndex };\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobius.icon.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/streamline-icons/mobius.icon.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,eAAe,CAAC;AAEhC,eAAO,MAAM,IAAI,WAAW,CAAC;AAE7B,eAAO,MAAM,SAAS,+CAQrB,CAAC;AAEF,eAAO,MAAM,OAAO,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// This file is autogenerated. Any changes will be overwritten.
|
|
3
|
+
export const set = 'streamline';
|
|
4
|
+
export const name = 'mobius';
|
|
5
|
+
export const Component = () => (_jsx("path", { fill: 'none', stroke: 'currentColor', strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M10.79 6.642c.69-.712 1.456-1.192 2.383-1.192 2.98 0 3.577 2.385 3.577 3.577 0 1.192-.596 3.577-3.577 3.577-3.577 0-4.77-7.154-8.346-7.154-2.98 0-3.577 2.385-3.577 3.577 0 1.192.596 3.577 3.577 3.577.927 0 1.695-.481 2.385-1.194' }));
|
|
6
|
+
export const viewBox = '0 0 18 18';
|
|
7
|
+
//# sourceMappingURL=mobius.icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobius.icon.js","sourceRoot":"","sources":["../../../../src/components/Icon/streamline-icons/mobius.icon.tsx"],"names":[],"mappings":";AAAA,+DAA+D;AAE/D,MAAM,CAAC,MAAM,GAAG,GAAG,YAAY,CAAC;AAEhC,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC;AAE7B,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAC7B,eACE,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,CAAC,EAAC,sOAAsO,GACxO,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\n\nexport const set = 'streamline';\n\nexport const name = 'mobius';\n\nexport const Component = () => (\n <path\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n d='M10.79 6.642c.69-.712 1.456-1.192 2.383-1.192 2.98 0 3.577 2.385 3.577 3.577 0 1.192-.596 3.577-3.577 3.577-3.577 0-4.77-7.154-8.346-7.154-2.98 0-3.577 2.385-3.577 3.577 0 1.192.596 3.577 3.577 3.577.927 0 1.695-.481 2.385-1.194'\n />\n);\n\nexport const viewBox = '0 0 18 18';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const streamlineIconNames: readonly ["ai-assist", "alexa", "align-center", "align-left", "align-right", "amazon", "api", "app", "archive-solid", "archive", "arrow-above-row-right", "arrow-bend-left", "arrow-down", "arrow-left-column", "arrow-left", "arrow-micro-down", "arrow-micro-left", "arrow-micro-right", "arrow-micro-up-down", "arrow-micro-up", "arrow-out", "arrow-right-column", "arrow-right", "arrow-up-down", "arrow-up", "article-solid", "article", "automation-call", "bank", "bars", "bell-push-notification", "bell-solid", "bell", "bluetooth", "book-open", "bookmark", "box-4", "box", "branch", "browser-code", "browser", "bug", "building-2", "building-3-solid", "building-3", "bulb", "calendar-empty", "calendar-now", "calendar-range", "calendar", "car", "caret-down", "caret-left", "caret-right", "caret-up", "cart-solid", "cart", "case-medical", "case-solid", "case", "chain", "chart-line", "chart-pie", "chat-check", "chat-exclamation-mark", "chat-help", "chat-quote", "chat-transfer", "chat-typing", "chat-unavailable", "chat", "chats", "check-badge", "check", "chevron-solid", "chevron", "circle-mixed-left", "circle-mixed-right", "circle-solid", "circle-stacked-mixed", "circle-stacked", "circle", "clipboard-check", "clipboard-medical", "clipboard-pencil-solid", "clipboard-pencil", "clipboard-plus", "clipboard", "clock-solid", "clock", "cloud", "code-search", "code", "column-delete", "condition-critical", "condition-satisfactory", "conversation", "copy", "credit", "csr-agent", "csr-connected", "currency", "custom-column", "database-search", "dataviz-area-multi", "dataviz-area-stacked", "dataviz-area", "dataviz-bar-clustered", "dataviz-bar-stacked", "dataviz-bar", "dataviz-bell-curve", "dataviz-bubble", "dataviz-column-clustered", "dataviz-column-stacked", "dataviz-column", "dataviz-combo", "dataviz-datetime-field", "dataviz-donut", "dataviz-flip-counter", "dataviz-forecast", "dataviz-funnel", "dataviz-gauge-linear", "dataviz-gauge-progress", "dataviz-gauge", "dataviz-geo-choropleth", "dataviz-heatmap", "dataviz-histogram", "dataviz-line-horizontal", "dataviz-line-multi", "dataviz-line-stepped", "dataviz-line", "dataviz-numeric-field", "dataviz-pareto", "dataviz-pie", "dataviz-pivot-table", "dataviz-radar", "dataviz-scatter", "dataviz-spark", "dataviz-sparklines-area", "dataviz-sparklines-columns", "dataviz-sparklines-line", "dataviz-sparklines-pies", "dataviz-spline", "dataviz-string-field", "dataviz-table-with-bars", "dataviz-trend-down", "dataviz-trend-up", "dataviz-waterfall", "desktop", "diamond-minus", "diamond", "disc-stack-solid", "disc-stack", "dock", "doctor-female", "doctor-male", "document-doc", "document-pdf", "document-xls", "document", "documents", "docusign", "dot-9-solid", "download", "drag", "email-open", "exchange", "expression", "eye-off", "face-blank", "face-happy", "face-sad", "facebook", "farming-wheat", "fast-forward", "field-cursor", "field-dot", "filetype-text", "filter-on", "filter", "fingerprint-search", "flag-check", "flag-finish", "flag-wave-solid", "flag-wave", "flashlight", "flow-process", "folder-closed", "folder-empty", "folder-hierarchy", "folder-nested", "folder-search", "folder", "folders", "forward-all", "forward", "freeze-column", "function", "galaxy", "gear-play", "gear-solid", "gear", "globe", "google", "government", "graduate", "grid-solid", "grid", "hand-book-open", "hand-over-paper", "hand", "handshake", "header", "headset", "help", "home-solid", "home", "house-bed", "house-person", "indent", "infinity", "information-solid", "information", "ios-face-id", "ios-finger-id", "keyboard", "knobs-solid", "knobs", "layers", "layout-connected", "layout-detached", "letter", "linkedin", "list-number", "list", "location-solid", "location", "lock-closed", "mail-solid", "mail-warning", "mail", "megaphone", "merge", "messages-to-chat", "mic-off", "mic", "micro-arrow-down", "micro-arrow-left", "micro-arrow-right", "micro-arrow-up", "minus", "mobile-phone", "module", "money-atm", "money", "monitor-lock", "more", "mountain-top", "multi-device", "navigation", "newspaper-fold", "newspaper", "nodes-down", "note-pin", "notepad", "number-decimal", "object-case-multi", "object-case-solid", "object-case", "object-status", "offer-list", "offer-table", "offer", "open-new-tab", "open", "opportunity-refresh", "opportunity", "os-apple", "paper-clip", "paper-search", "password-lock", "pause", "paypal", "pega", "pegasus", "pencil", "people-group-stakeholders", "percentage", "person-connection", "person-hierarchy-check", "person-stars", "person", "persons-group", "phone-call", "phone-dial", "phone-hangup", "phone-in-solid", "phone-in", "phone-ivr", "phone-off", "phone-out", "phone-split", "phone-transfer", "phone", "phonebook", "picture-solid", "picture", "play-solid", "play", "plug-solid", "plug", "plus", "polaris-solid", "polaris", "presentation", "product", "project-plan", "project", "qr", "receipt", "reply-all", "reply", "reset", "robot-happy", "robot-sad", "robot-solid", "robot", "rocket-solid", "rocket", "roof-people", "rounded-extra-large", "rounded-large", "rounded-medium", "rounded-none", "rounded-pill", "rounded-small", "row-delete", "row-insert", "row", "rule-library-solid", "rule-library", "rule", "scale-down", "scale-up", "script", "search-analytics-solid", "search-analytics", "search", "send", "server", "set", "share", "shield-solid", "shield", "shipment-box", "shop", "shuffle", "sigma", "slideshow-solid", "slideshow", "snow", "spacing-condensed", "spacing-expanded", "spacing-standard", "speaker-on-sold", "speaker-on", "speaker", "split", "stakeholders", "star-mixed", "star-solid", "star", "sub-step", "table-bolt-solid", "table-bolt", "table", "tag", "target-path", "target", "team", "thumbs-down-solid", "thumbs-down", "thumbs-up-solid", "thumbs-up", "times", "todo", "toolbox-open", "toolbox-wrench", "transform", "trash", "tribox", "twitter", "two-disk-stacks", "type-cursor", "umbrella", "undock", "unindent", "unwrap", "upload", "user-check-solid", "user-check", "user-close-solid", "user-close", "user-document", "user-female-solid", "user-female", "user-information", "user-list-solid", "user-list", "user-pencil", "user-plus-solid", "user-plus", "user-question-mark-solid", "user-question-mark", "user-search-solid", "user-search", "user-solid", "user-star-solid", "user-star", "user-unavailable", "user", "users-solid", "users", "variable", "versions", "video-off", "video-solid", "video", "voice", "voicemail", "vr-solid", "vr", "walkie-solid", "walkie", "wallet-solid", "wallet", "wand", "warn-solid", "warn", "watch-solid", "watch", "waypoint-solid", "waypoint", "webcam-solid", "webcam", "whatsapp", "widget", "wifi-none", "wifi-off", "wifi", "wizard-solid", "wizard", "wrap", "wrench-solid", "wrench", "youtube"];
|
|
1
|
+
declare const streamlineIconNames: readonly ["ai-assist", "alexa", "align-center", "align-left", "align-right", "amazon", "api", "app", "archive-solid", "archive", "arrow-above-row-right", "arrow-bend-left", "arrow-down", "arrow-left-column", "arrow-left", "arrow-micro-down", "arrow-micro-left", "arrow-micro-right", "arrow-micro-up-down", "arrow-micro-up", "arrow-out", "arrow-right-column", "arrow-right", "arrow-up-down", "arrow-up", "article-solid", "article", "automation-call", "bank", "bars", "bell-push-notification", "bell-solid", "bell", "bluetooth", "book-open", "bookmark", "box-4", "box", "branch", "browser-code", "browser", "bug", "building-2", "building-3-solid", "building-3", "bulb", "calendar-empty", "calendar-now", "calendar-range", "calendar", "car", "caret-down", "caret-left", "caret-right", "caret-up", "cart-solid", "cart", "case-medical", "case-solid", "case", "chain", "chart-line", "chart-pie", "chat-check", "chat-exclamation-mark", "chat-help", "chat-quote", "chat-transfer", "chat-typing", "chat-unavailable", "chat", "chats", "check-badge", "check", "chevron-solid", "chevron", "circle-mixed-left", "circle-mixed-right", "circle-solid", "circle-stacked-mixed", "circle-stacked", "circle", "clipboard-check", "clipboard-medical", "clipboard-pencil-solid", "clipboard-pencil", "clipboard-plus", "clipboard", "clock-solid", "clock", "cloud", "code-search", "code", "column-delete", "condition-critical", "condition-satisfactory", "conversation", "copy", "credit", "csr-agent", "csr-connected", "currency", "custom-column", "database-search", "dataviz-area-multi", "dataviz-area-stacked", "dataviz-area", "dataviz-bar-clustered", "dataviz-bar-stacked", "dataviz-bar", "dataviz-bell-curve", "dataviz-bubble", "dataviz-column-clustered", "dataviz-column-stacked", "dataviz-column", "dataviz-combo", "dataviz-datetime-field", "dataviz-donut", "dataviz-flip-counter", "dataviz-forecast", "dataviz-funnel", "dataviz-gauge-linear", "dataviz-gauge-progress", "dataviz-gauge", "dataviz-geo-choropleth", "dataviz-heatmap", "dataviz-histogram", "dataviz-line-horizontal", "dataviz-line-multi", "dataviz-line-stepped", "dataviz-line", "dataviz-numeric-field", "dataviz-pareto", "dataviz-pie", "dataviz-pivot-table", "dataviz-radar", "dataviz-scatter", "dataviz-spark", "dataviz-sparklines-area", "dataviz-sparklines-columns", "dataviz-sparklines-line", "dataviz-sparklines-pies", "dataviz-spline", "dataviz-string-field", "dataviz-table-with-bars", "dataviz-trend-down", "dataviz-trend-up", "dataviz-waterfall", "desktop", "diamond-minus", "diamond", "disc-stack-solid", "disc-stack", "dock", "doctor-female", "doctor-male", "document-doc", "document-pdf", "document-xls", "document", "documents", "docusign", "dot-9-solid", "download", "drag", "email-open", "exchange", "expression", "eye-off", "face-blank", "face-happy", "face-sad", "facebook", "farming-wheat", "fast-forward", "field-cursor", "field-dot", "filetype-text", "filter-on", "filter", "fingerprint-search", "flag-check", "flag-finish", "flag-wave-solid", "flag-wave", "flashlight", "flow-process", "folder-closed", "folder-empty", "folder-hierarchy", "folder-nested", "folder-search", "folder", "folders", "forward-all", "forward", "freeze-column", "function", "galaxy", "gear-play", "gear-solid", "gear", "globe", "google", "government", "graduate", "grid-solid", "grid", "hand-book-open", "hand-over-paper", "hand", "handshake", "header", "headset", "help", "home-solid", "home", "house-bed", "house-person", "indent", "infinity", "information-solid", "information", "ios-face-id", "ios-finger-id", "keyboard", "knobs-solid", "knobs", "layers", "layout-connected", "layout-detached", "letter", "linkedin", "list-number", "list", "location-solid", "location", "lock-closed", "mail-solid", "mail-warning", "mail", "megaphone", "merge", "messages-to-chat", "mic-off", "mic", "micro-arrow-down", "micro-arrow-left", "micro-arrow-right", "micro-arrow-up", "minus", "mobile-phone", "mobius", "module", "money-atm", "money", "monitor-lock", "more", "mountain-top", "multi-device", "navigation", "newspaper-fold", "newspaper", "nodes-down", "note-pin", "notepad", "number-decimal", "object-case-multi", "object-case-solid", "object-case", "object-status", "offer-list", "offer-table", "offer", "open-new-tab", "open", "opportunity-refresh", "opportunity", "os-apple", "paper-clip", "paper-search", "password-lock", "pause", "paypal", "pega", "pegasus", "pencil", "people-group-stakeholders", "percentage", "person-connection", "person-hierarchy-check", "person-stars", "person", "persons-group", "phone-call", "phone-dial", "phone-hangup", "phone-in-solid", "phone-in", "phone-ivr", "phone-off", "phone-out", "phone-split", "phone-transfer", "phone", "phonebook", "picture-solid", "picture", "play-solid", "play", "plug-solid", "plug", "plus", "polaris-solid", "polaris", "presentation", "product", "project-plan", "project", "qr", "receipt", "reply-all", "reply", "reset", "robot-happy", "robot-sad", "robot-solid", "robot", "rocket-solid", "rocket", "roof-people", "rounded-extra-large", "rounded-large", "rounded-medium", "rounded-none", "rounded-pill", "rounded-small", "row-delete", "row-insert", "row", "rule-library-solid", "rule-library", "rule", "scale-down", "scale-up", "script", "search-analytics-solid", "search-analytics", "search", "send", "server", "set", "share", "shield-solid", "shield", "shipment-box", "shop", "shuffle", "sigma", "slideshow-solid", "slideshow", "snow", "spacing-condensed", "spacing-expanded", "spacing-standard", "speaker-on-sold", "speaker-on", "speaker", "split", "stakeholders", "star-mixed", "star-solid", "star", "sub-step", "table-bolt-solid", "table-bolt", "table", "tag", "target-path", "target", "team", "thumbs-down-solid", "thumbs-down", "thumbs-up-solid", "thumbs-up", "times", "todo", "toolbox-open", "toolbox-wrench", "transform", "trash", "tribox", "twitter", "two-disk-stacks", "type-cursor", "umbrella", "undock", "unindent", "unwrap", "upload", "user-check-solid", "user-check", "user-close-solid", "user-close", "user-document", "user-female-solid", "user-female", "user-information", "user-list-solid", "user-list", "user-pencil", "user-plus-solid", "user-plus", "user-question-mark-solid", "user-question-mark", "user-search-solid", "user-search", "user-solid", "user-star-solid", "user-star", "user-unavailable", "user", "users-solid", "users", "variable", "versions", "video-off", "video-solid", "video", "voice", "voicemail", "vr-solid", "vr", "walkie-solid", "walkie", "wallet-solid", "wallet", "wand", "warn-solid", "warn", "watch-solid", "watch", "waypoint-solid", "waypoint", "webcam-solid", "webcam", "whatsapp", "widget", "wifi-none", "wifi-off", "wifi", "wizard-solid", "wizard", "wrap", "wrench-solid", "wrench", "youtube"];
|
|
2
2
|
export default streamlineIconNames;
|
|
3
3
|
export type StreamlineIconName = (typeof streamlineIconNames)[number];
|
|
4
4
|
//# sourceMappingURL=streamlineIconNames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamlineIconNames.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/streamlineIconNames.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"streamlineIconNames.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/streamlineIconNames.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,mBAAmB,mlNA0cf,CAAC;AAEX,eAAe,mBAAmB,CAAC;AAEnC,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamlineIconNames.js","sourceRoot":"","sources":["../../../src/components/Icon/streamlineIconNames.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,MAAM,mBAAmB,GAAG;IAC1B,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;IACZ,aAAa;IACb,QAAQ;IACR,KAAK;IACL,KAAK;IACL,eAAe;IACf,SAAS;IACT,uBAAuB;IACvB,iBAAiB;IACjB,YAAY;IACZ,mBAAmB;IACnB,YAAY;IACZ,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,qBAAqB;IACrB,gBAAgB;IAChB,WAAW;IACX,oBAAoB;IACpB,aAAa;IACb,eAAe;IACf,UAAU;IACV,eAAe;IACf,SAAS;IACT,iBAAiB;IACjB,MAAM;IACN,MAAM;IACN,wBAAwB;IACxB,YAAY;IACZ,MAAM;IACN,WAAW;IACX,WAAW;IACX,UAAU;IACV,OAAO;IACP,KAAK;IACL,QAAQ;IACR,cAAc;IACd,SAAS;IACT,KAAK;IACL,YAAY;IACZ,kBAAkB;IAClB,YAAY;IACZ,MAAM;IACN,gBAAgB;IAChB,cAAc;IACd,gBAAgB;IAChB,UAAU;IACV,KAAK;IACL,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,UAAU;IACV,YAAY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;IAClB,iBAAiB;IACjB,YAAY;IACZ,SAAS;IACT,OAAO;IACP,cAAc;IACd,YAAY;IACZ,YAAY;IACZ,MAAM;IACN,UAAU;IACV,kBAAkB;IAClB,YAAY;IACZ,OAAO;IACP,KAAK;IACL,aAAa;IACb,QAAQ;IACR,MAAM;IACN,mBAAmB;IACnB,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,OAAO;IACP,MAAM;IACN,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,OAAO;IACP,QAAQ;IACR,SAAS;IACT,iBAAiB;IACjB,aAAa;IACb,UAAU;IACV,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,kBAAkB;IAClB,YAAY;IACZ,kBAAkB;IAClB,YAAY;IACZ,eAAe;IACf,mBAAmB;IACnB,aAAa;IACb,kBAAkB;IAClB,iBAAiB;IACjB,WAAW;IACX,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,0BAA0B;IAC1B,oBAAoB;IACpB,mBAAmB;IACnB,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,WAAW;IACX,kBAAkB;IAClB,MAAM;IACN,aAAa;IACb,OAAO;IACP,UAAU;IACV,UAAU;IACV,WAAW;IACX,aAAa;IACb,OAAO;IACP,OAAO;IACP,WAAW;IACX,UAAU;IACV,IAAI;IACJ,cAAc;IACd,QAAQ;IACR,cAAc;IACd,QAAQ;IACR,MAAM;IACN,YAAY;IACZ,MAAM;IACN,aAAa;IACb,OAAO;IACP,gBAAgB;IAChB,UAAU;IACV,cAAc;IACd,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,WAAW;IACX,UAAU;IACV,MAAM;IACN,cAAc;IACd,QAAQ;IACR,MAAM;IACN,cAAc;IACd,QAAQ;IACR,SAAS;CACD,CAAC;AAEX,eAAe,mBAAmB,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\n\nconst streamlineIconNames = [\n 'ai-assist',\n 'alexa',\n 'align-center',\n 'align-left',\n 'align-right',\n 'amazon',\n 'api',\n 'app',\n 'archive-solid',\n 'archive',\n 'arrow-above-row-right',\n 'arrow-bend-left',\n 'arrow-down',\n 'arrow-left-column',\n 'arrow-left',\n 'arrow-micro-down',\n 'arrow-micro-left',\n 'arrow-micro-right',\n 'arrow-micro-up-down',\n 'arrow-micro-up',\n 'arrow-out',\n 'arrow-right-column',\n 'arrow-right',\n 'arrow-up-down',\n 'arrow-up',\n 'article-solid',\n 'article',\n 'automation-call',\n 'bank',\n 'bars',\n 'bell-push-notification',\n 'bell-solid',\n 'bell',\n 'bluetooth',\n 'book-open',\n 'bookmark',\n 'box-4',\n 'box',\n 'branch',\n 'browser-code',\n 'browser',\n 'bug',\n 'building-2',\n 'building-3-solid',\n 'building-3',\n 'bulb',\n 'calendar-empty',\n 'calendar-now',\n 'calendar-range',\n 'calendar',\n 'car',\n 'caret-down',\n 'caret-left',\n 'caret-right',\n 'caret-up',\n 'cart-solid',\n 'cart',\n 'case-medical',\n 'case-solid',\n 'case',\n 'chain',\n 'chart-line',\n 'chart-pie',\n 'chat-check',\n 'chat-exclamation-mark',\n 'chat-help',\n 'chat-quote',\n 'chat-transfer',\n 'chat-typing',\n 'chat-unavailable',\n 'chat',\n 'chats',\n 'check-badge',\n 'check',\n 'chevron-solid',\n 'chevron',\n 'circle-mixed-left',\n 'circle-mixed-right',\n 'circle-solid',\n 'circle-stacked-mixed',\n 'circle-stacked',\n 'circle',\n 'clipboard-check',\n 'clipboard-medical',\n 'clipboard-pencil-solid',\n 'clipboard-pencil',\n 'clipboard-plus',\n 'clipboard',\n 'clock-solid',\n 'clock',\n 'cloud',\n 'code-search',\n 'code',\n 'column-delete',\n 'condition-critical',\n 'condition-satisfactory',\n 'conversation',\n 'copy',\n 'credit',\n 'csr-agent',\n 'csr-connected',\n 'currency',\n 'custom-column',\n 'database-search',\n 'dataviz-area-multi',\n 'dataviz-area-stacked',\n 'dataviz-area',\n 'dataviz-bar-clustered',\n 'dataviz-bar-stacked',\n 'dataviz-bar',\n 'dataviz-bell-curve',\n 'dataviz-bubble',\n 'dataviz-column-clustered',\n 'dataviz-column-stacked',\n 'dataviz-column',\n 'dataviz-combo',\n 'dataviz-datetime-field',\n 'dataviz-donut',\n 'dataviz-flip-counter',\n 'dataviz-forecast',\n 'dataviz-funnel',\n 'dataviz-gauge-linear',\n 'dataviz-gauge-progress',\n 'dataviz-gauge',\n 'dataviz-geo-choropleth',\n 'dataviz-heatmap',\n 'dataviz-histogram',\n 'dataviz-line-horizontal',\n 'dataviz-line-multi',\n 'dataviz-line-stepped',\n 'dataviz-line',\n 'dataviz-numeric-field',\n 'dataviz-pareto',\n 'dataviz-pie',\n 'dataviz-pivot-table',\n 'dataviz-radar',\n 'dataviz-scatter',\n 'dataviz-spark',\n 'dataviz-sparklines-area',\n 'dataviz-sparklines-columns',\n 'dataviz-sparklines-line',\n 'dataviz-sparklines-pies',\n 'dataviz-spline',\n 'dataviz-string-field',\n 'dataviz-table-with-bars',\n 'dataviz-trend-down',\n 'dataviz-trend-up',\n 'dataviz-waterfall',\n 'desktop',\n 'diamond-minus',\n 'diamond',\n 'disc-stack-solid',\n 'disc-stack',\n 'dock',\n 'doctor-female',\n 'doctor-male',\n 'document-doc',\n 'document-pdf',\n 'document-xls',\n 'document',\n 'documents',\n 'docusign',\n 'dot-9-solid',\n 'download',\n 'drag',\n 'email-open',\n 'exchange',\n 'expression',\n 'eye-off',\n 'face-blank',\n 'face-happy',\n 'face-sad',\n 'facebook',\n 'farming-wheat',\n 'fast-forward',\n 'field-cursor',\n 'field-dot',\n 'filetype-text',\n 'filter-on',\n 'filter',\n 'fingerprint-search',\n 'flag-check',\n 'flag-finish',\n 'flag-wave-solid',\n 'flag-wave',\n 'flashlight',\n 'flow-process',\n 'folder-closed',\n 'folder-empty',\n 'folder-hierarchy',\n 'folder-nested',\n 'folder-search',\n 'folder',\n 'folders',\n 'forward-all',\n 'forward',\n 'freeze-column',\n 'function',\n 'galaxy',\n 'gear-play',\n 'gear-solid',\n 'gear',\n 'globe',\n 'google',\n 'government',\n 'graduate',\n 'grid-solid',\n 'grid',\n 'hand-book-open',\n 'hand-over-paper',\n 'hand',\n 'handshake',\n 'header',\n 'headset',\n 'help',\n 'home-solid',\n 'home',\n 'house-bed',\n 'house-person',\n 'indent',\n 'infinity',\n 'information-solid',\n 'information',\n 'ios-face-id',\n 'ios-finger-id',\n 'keyboard',\n 'knobs-solid',\n 'knobs',\n 'layers',\n 'layout-connected',\n 'layout-detached',\n 'letter',\n 'linkedin',\n 'list-number',\n 'list',\n 'location-solid',\n 'location',\n 'lock-closed',\n 'mail-solid',\n 'mail-warning',\n 'mail',\n 'megaphone',\n 'merge',\n 'messages-to-chat',\n 'mic-off',\n 'mic',\n 'micro-arrow-down',\n 'micro-arrow-left',\n 'micro-arrow-right',\n 'micro-arrow-up',\n 'minus',\n 'mobile-phone',\n 'module',\n 'money-atm',\n 'money',\n 'monitor-lock',\n 'more',\n 'mountain-top',\n 'multi-device',\n 'navigation',\n 'newspaper-fold',\n 'newspaper',\n 'nodes-down',\n 'note-pin',\n 'notepad',\n 'number-decimal',\n 'object-case-multi',\n 'object-case-solid',\n 'object-case',\n 'object-status',\n 'offer-list',\n 'offer-table',\n 'offer',\n 'open-new-tab',\n 'open',\n 'opportunity-refresh',\n 'opportunity',\n 'os-apple',\n 'paper-clip',\n 'paper-search',\n 'password-lock',\n 'pause',\n 'paypal',\n 'pega',\n 'pegasus',\n 'pencil',\n 'people-group-stakeholders',\n 'percentage',\n 'person-connection',\n 'person-hierarchy-check',\n 'person-stars',\n 'person',\n 'persons-group',\n 'phone-call',\n 'phone-dial',\n 'phone-hangup',\n 'phone-in-solid',\n 'phone-in',\n 'phone-ivr',\n 'phone-off',\n 'phone-out',\n 'phone-split',\n 'phone-transfer',\n 'phone',\n 'phonebook',\n 'picture-solid',\n 'picture',\n 'play-solid',\n 'play',\n 'plug-solid',\n 'plug',\n 'plus',\n 'polaris-solid',\n 'polaris',\n 'presentation',\n 'product',\n 'project-plan',\n 'project',\n 'qr',\n 'receipt',\n 'reply-all',\n 'reply',\n 'reset',\n 'robot-happy',\n 'robot-sad',\n 'robot-solid',\n 'robot',\n 'rocket-solid',\n 'rocket',\n 'roof-people',\n 'rounded-extra-large',\n 'rounded-large',\n 'rounded-medium',\n 'rounded-none',\n 'rounded-pill',\n 'rounded-small',\n 'row-delete',\n 'row-insert',\n 'row',\n 'rule-library-solid',\n 'rule-library',\n 'rule',\n 'scale-down',\n 'scale-up',\n 'script',\n 'search-analytics-solid',\n 'search-analytics',\n 'search',\n 'send',\n 'server',\n 'set',\n 'share',\n 'shield-solid',\n 'shield',\n 'shipment-box',\n 'shop',\n 'shuffle',\n 'sigma',\n 'slideshow-solid',\n 'slideshow',\n 'snow',\n 'spacing-condensed',\n 'spacing-expanded',\n 'spacing-standard',\n 'speaker-on-sold',\n 'speaker-on',\n 'speaker',\n 'split',\n 'stakeholders',\n 'star-mixed',\n 'star-solid',\n 'star',\n 'sub-step',\n 'table-bolt-solid',\n 'table-bolt',\n 'table',\n 'tag',\n 'target-path',\n 'target',\n 'team',\n 'thumbs-down-solid',\n 'thumbs-down',\n 'thumbs-up-solid',\n 'thumbs-up',\n 'times',\n 'todo',\n 'toolbox-open',\n 'toolbox-wrench',\n 'transform',\n 'trash',\n 'tribox',\n 'twitter',\n 'two-disk-stacks',\n 'type-cursor',\n 'umbrella',\n 'undock',\n 'unindent',\n 'unwrap',\n 'upload',\n 'user-check-solid',\n 'user-check',\n 'user-close-solid',\n 'user-close',\n 'user-document',\n 'user-female-solid',\n 'user-female',\n 'user-information',\n 'user-list-solid',\n 'user-list',\n 'user-pencil',\n 'user-plus-solid',\n 'user-plus',\n 'user-question-mark-solid',\n 'user-question-mark',\n 'user-search-solid',\n 'user-search',\n 'user-solid',\n 'user-star-solid',\n 'user-star',\n 'user-unavailable',\n 'user',\n 'users-solid',\n 'users',\n 'variable',\n 'versions',\n 'video-off',\n 'video-solid',\n 'video',\n 'voice',\n 'voicemail',\n 'vr-solid',\n 'vr',\n 'walkie-solid',\n 'walkie',\n 'wallet-solid',\n 'wallet',\n 'wand',\n 'warn-solid',\n 'warn',\n 'watch-solid',\n 'watch',\n 'waypoint-solid',\n 'waypoint',\n 'webcam-solid',\n 'webcam',\n 'whatsapp',\n 'widget',\n 'wifi-none',\n 'wifi-off',\n 'wifi',\n 'wizard-solid',\n 'wizard',\n 'wrap',\n 'wrench-solid',\n 'wrench',\n 'youtube'\n] as const;\n\nexport default streamlineIconNames;\n\nexport type StreamlineIconName = (typeof streamlineIconNames)[number];\n"]}
|
|
1
|
+
{"version":3,"file":"streamlineIconNames.js","sourceRoot":"","sources":["../../../src/components/Icon/streamlineIconNames.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,MAAM,mBAAmB,GAAG;IAC1B,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;IACZ,aAAa;IACb,QAAQ;IACR,KAAK;IACL,KAAK;IACL,eAAe;IACf,SAAS;IACT,uBAAuB;IACvB,iBAAiB;IACjB,YAAY;IACZ,mBAAmB;IACnB,YAAY;IACZ,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,qBAAqB;IACrB,gBAAgB;IAChB,WAAW;IACX,oBAAoB;IACpB,aAAa;IACb,eAAe;IACf,UAAU;IACV,eAAe;IACf,SAAS;IACT,iBAAiB;IACjB,MAAM;IACN,MAAM;IACN,wBAAwB;IACxB,YAAY;IACZ,MAAM;IACN,WAAW;IACX,WAAW;IACX,UAAU;IACV,OAAO;IACP,KAAK;IACL,QAAQ;IACR,cAAc;IACd,SAAS;IACT,KAAK;IACL,YAAY;IACZ,kBAAkB;IAClB,YAAY;IACZ,MAAM;IACN,gBAAgB;IAChB,cAAc;IACd,gBAAgB;IAChB,UAAU;IACV,KAAK;IACL,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,UAAU;IACV,YAAY;IACZ,MAAM;IACN,cAAc;IACd,YAAY;IACZ,MAAM;IACN,OAAO;IACP,YAAY;IACZ,WAAW;IACX,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ACZ,YAAY;IACZ,MAAM;IACN,UAAU;IACV,kBAAkB;IAClB,YAAY;IACZ,OAAO;IACP,KAAK;IACL,aAAa;IACb,QAAQ;IACR,MAAM;IACN,mBAAmB;IACnB,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,OAAO;IACP,MAAM;IACN,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,OAAO;IACP,QAAQ;IACR,SAAS;IACT,iBAAiB;IACjB,aAAa;IACb,UAAU;IACV,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,kBAAkB;IAClB,YAAY;IACZ,kBAAkB;IAClB,YAAY;IACZ,eAAe;IACf,mBAAmB;IACnB,aAAa;IACb,kBAAkB;IAClB,iBAAiB;IACjB,WAAW;IACX,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,0BAA0B;IAC1B,oBAAoB;IACpB,mBAAmB;IACnB,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,WAAW;IACX,kBAAkB;IAClB,MAAM;IACN,aAAa;IACb,OAAO;IACP,UAAU;IACV,UAAU;IACV,WAAW;IACX,aAAa;IACb,OAAO;IACP,OAAO;IACP,WAAW;IACX,UAAU;IACV,IAAI;IACJ,cAAc;IACd,QAAQ;IACR,cAAc;IACd,QAAQ;IACR,MAAM;IACN,YAAY;IACZ,MAAM;IACN,aAAa;IACb,OAAO;IACP,gBAAgB;IAChB,UAAU;IACV,cAAc;IACd,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,WAAW;IACX,UAAU;IACV,MAAM;IACN,cAAc;IACd,QAAQ;IACR,MAAM;IACN,cAAc;IACd,QAAQ;IACR,SAAS;CACD,CAAC;AAEX,eAAe,mBAAmB,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\n\nconst streamlineIconNames = [\n 'ai-assist',\n 'alexa',\n 'align-center',\n 'align-left',\n 'align-right',\n 'amazon',\n 'api',\n 'app',\n 'archive-solid',\n 'archive',\n 'arrow-above-row-right',\n 'arrow-bend-left',\n 'arrow-down',\n 'arrow-left-column',\n 'arrow-left',\n 'arrow-micro-down',\n 'arrow-micro-left',\n 'arrow-micro-right',\n 'arrow-micro-up-down',\n 'arrow-micro-up',\n 'arrow-out',\n 'arrow-right-column',\n 'arrow-right',\n 'arrow-up-down',\n 'arrow-up',\n 'article-solid',\n 'article',\n 'automation-call',\n 'bank',\n 'bars',\n 'bell-push-notification',\n 'bell-solid',\n 'bell',\n 'bluetooth',\n 'book-open',\n 'bookmark',\n 'box-4',\n 'box',\n 'branch',\n 'browser-code',\n 'browser',\n 'bug',\n 'building-2',\n 'building-3-solid',\n 'building-3',\n 'bulb',\n 'calendar-empty',\n 'calendar-now',\n 'calendar-range',\n 'calendar',\n 'car',\n 'caret-down',\n 'caret-left',\n 'caret-right',\n 'caret-up',\n 'cart-solid',\n 'cart',\n 'case-medical',\n 'case-solid',\n 'case',\n 'chain',\n 'chart-line',\n 'chart-pie',\n 'chat-check',\n 'chat-exclamation-mark',\n 'chat-help',\n 'chat-quote',\n 'chat-transfer',\n 'chat-typing',\n 'chat-unavailable',\n 'chat',\n 'chats',\n 'check-badge',\n 'check',\n 'chevron-solid',\n 'chevron',\n 'circle-mixed-left',\n 'circle-mixed-right',\n 'circle-solid',\n 'circle-stacked-mixed',\n 'circle-stacked',\n 'circle',\n 'clipboard-check',\n 'clipboard-medical',\n 'clipboard-pencil-solid',\n 'clipboard-pencil',\n 'clipboard-plus',\n 'clipboard',\n 'clock-solid',\n 'clock',\n 'cloud',\n 'code-search',\n 'code',\n 'column-delete',\n 'condition-critical',\n 'condition-satisfactory',\n 'conversation',\n 'copy',\n 'credit',\n 'csr-agent',\n 'csr-connected',\n 'currency',\n 'custom-column',\n 'database-search',\n 'dataviz-area-multi',\n 'dataviz-area-stacked',\n 'dataviz-area',\n 'dataviz-bar-clustered',\n 'dataviz-bar-stacked',\n 'dataviz-bar',\n 'dataviz-bell-curve',\n 'dataviz-bubble',\n 'dataviz-column-clustered',\n 'dataviz-column-stacked',\n 'dataviz-column',\n 'dataviz-combo',\n 'dataviz-datetime-field',\n 'dataviz-donut',\n 'dataviz-flip-counter',\n 'dataviz-forecast',\n 'dataviz-funnel',\n 'dataviz-gauge-linear',\n 'dataviz-gauge-progress',\n 'dataviz-gauge',\n 'dataviz-geo-choropleth',\n 'dataviz-heatmap',\n 'dataviz-histogram',\n 'dataviz-line-horizontal',\n 'dataviz-line-multi',\n 'dataviz-line-stepped',\n 'dataviz-line',\n 'dataviz-numeric-field',\n 'dataviz-pareto',\n 'dataviz-pie',\n 'dataviz-pivot-table',\n 'dataviz-radar',\n 'dataviz-scatter',\n 'dataviz-spark',\n 'dataviz-sparklines-area',\n 'dataviz-sparklines-columns',\n 'dataviz-sparklines-line',\n 'dataviz-sparklines-pies',\n 'dataviz-spline',\n 'dataviz-string-field',\n 'dataviz-table-with-bars',\n 'dataviz-trend-down',\n 'dataviz-trend-up',\n 'dataviz-waterfall',\n 'desktop',\n 'diamond-minus',\n 'diamond',\n 'disc-stack-solid',\n 'disc-stack',\n 'dock',\n 'doctor-female',\n 'doctor-male',\n 'document-doc',\n 'document-pdf',\n 'document-xls',\n 'document',\n 'documents',\n 'docusign',\n 'dot-9-solid',\n 'download',\n 'drag',\n 'email-open',\n 'exchange',\n 'expression',\n 'eye-off',\n 'face-blank',\n 'face-happy',\n 'face-sad',\n 'facebook',\n 'farming-wheat',\n 'fast-forward',\n 'field-cursor',\n 'field-dot',\n 'filetype-text',\n 'filter-on',\n 'filter',\n 'fingerprint-search',\n 'flag-check',\n 'flag-finish',\n 'flag-wave-solid',\n 'flag-wave',\n 'flashlight',\n 'flow-process',\n 'folder-closed',\n 'folder-empty',\n 'folder-hierarchy',\n 'folder-nested',\n 'folder-search',\n 'folder',\n 'folders',\n 'forward-all',\n 'forward',\n 'freeze-column',\n 'function',\n 'galaxy',\n 'gear-play',\n 'gear-solid',\n 'gear',\n 'globe',\n 'google',\n 'government',\n 'graduate',\n 'grid-solid',\n 'grid',\n 'hand-book-open',\n 'hand-over-paper',\n 'hand',\n 'handshake',\n 'header',\n 'headset',\n 'help',\n 'home-solid',\n 'home',\n 'house-bed',\n 'house-person',\n 'indent',\n 'infinity',\n 'information-solid',\n 'information',\n 'ios-face-id',\n 'ios-finger-id',\n 'keyboard',\n 'knobs-solid',\n 'knobs',\n 'layers',\n 'layout-connected',\n 'layout-detached',\n 'letter',\n 'linkedin',\n 'list-number',\n 'list',\n 'location-solid',\n 'location',\n 'lock-closed',\n 'mail-solid',\n 'mail-warning',\n 'mail',\n 'megaphone',\n 'merge',\n 'messages-to-chat',\n 'mic-off',\n 'mic',\n 'micro-arrow-down',\n 'micro-arrow-left',\n 'micro-arrow-right',\n 'micro-arrow-up',\n 'minus',\n 'mobile-phone',\n 'mobius',\n 'module',\n 'money-atm',\n 'money',\n 'monitor-lock',\n 'more',\n 'mountain-top',\n 'multi-device',\n 'navigation',\n 'newspaper-fold',\n 'newspaper',\n 'nodes-down',\n 'note-pin',\n 'notepad',\n 'number-decimal',\n 'object-case-multi',\n 'object-case-solid',\n 'object-case',\n 'object-status',\n 'offer-list',\n 'offer-table',\n 'offer',\n 'open-new-tab',\n 'open',\n 'opportunity-refresh',\n 'opportunity',\n 'os-apple',\n 'paper-clip',\n 'paper-search',\n 'password-lock',\n 'pause',\n 'paypal',\n 'pega',\n 'pegasus',\n 'pencil',\n 'people-group-stakeholders',\n 'percentage',\n 'person-connection',\n 'person-hierarchy-check',\n 'person-stars',\n 'person',\n 'persons-group',\n 'phone-call',\n 'phone-dial',\n 'phone-hangup',\n 'phone-in-solid',\n 'phone-in',\n 'phone-ivr',\n 'phone-off',\n 'phone-out',\n 'phone-split',\n 'phone-transfer',\n 'phone',\n 'phonebook',\n 'picture-solid',\n 'picture',\n 'play-solid',\n 'play',\n 'plug-solid',\n 'plug',\n 'plus',\n 'polaris-solid',\n 'polaris',\n 'presentation',\n 'product',\n 'project-plan',\n 'project',\n 'qr',\n 'receipt',\n 'reply-all',\n 'reply',\n 'reset',\n 'robot-happy',\n 'robot-sad',\n 'robot-solid',\n 'robot',\n 'rocket-solid',\n 'rocket',\n 'roof-people',\n 'rounded-extra-large',\n 'rounded-large',\n 'rounded-medium',\n 'rounded-none',\n 'rounded-pill',\n 'rounded-small',\n 'row-delete',\n 'row-insert',\n 'row',\n 'rule-library-solid',\n 'rule-library',\n 'rule',\n 'scale-down',\n 'scale-up',\n 'script',\n 'search-analytics-solid',\n 'search-analytics',\n 'search',\n 'send',\n 'server',\n 'set',\n 'share',\n 'shield-solid',\n 'shield',\n 'shipment-box',\n 'shop',\n 'shuffle',\n 'sigma',\n 'slideshow-solid',\n 'slideshow',\n 'snow',\n 'spacing-condensed',\n 'spacing-expanded',\n 'spacing-standard',\n 'speaker-on-sold',\n 'speaker-on',\n 'speaker',\n 'split',\n 'stakeholders',\n 'star-mixed',\n 'star-solid',\n 'star',\n 'sub-step',\n 'table-bolt-solid',\n 'table-bolt',\n 'table',\n 'tag',\n 'target-path',\n 'target',\n 'team',\n 'thumbs-down-solid',\n 'thumbs-down',\n 'thumbs-up-solid',\n 'thumbs-up',\n 'times',\n 'todo',\n 'toolbox-open',\n 'toolbox-wrench',\n 'transform',\n 'trash',\n 'tribox',\n 'twitter',\n 'two-disk-stacks',\n 'type-cursor',\n 'umbrella',\n 'undock',\n 'unindent',\n 'unwrap',\n 'upload',\n 'user-check-solid',\n 'user-check',\n 'user-close-solid',\n 'user-close',\n 'user-document',\n 'user-female-solid',\n 'user-female',\n 'user-information',\n 'user-list-solid',\n 'user-list',\n 'user-pencil',\n 'user-plus-solid',\n 'user-plus',\n 'user-question-mark-solid',\n 'user-question-mark',\n 'user-search-solid',\n 'user-search',\n 'user-solid',\n 'user-star-solid',\n 'user-star',\n 'user-unavailable',\n 'user',\n 'users-solid',\n 'users',\n 'variable',\n 'versions',\n 'video-off',\n 'video-solid',\n 'video',\n 'voice',\n 'voicemail',\n 'vr-solid',\n 'vr',\n 'walkie-solid',\n 'walkie',\n 'wallet-solid',\n 'wallet',\n 'wand',\n 'warn-solid',\n 'warn',\n 'watch-solid',\n 'watch',\n 'waypoint-solid',\n 'waypoint',\n 'webcam-solid',\n 'webcam',\n 'whatsapp',\n 'widget',\n 'wifi-none',\n 'wifi-off',\n 'wifi',\n 'wizard-solid',\n 'wizard',\n 'wrap',\n 'wrench-solid',\n 'wrench',\n 'youtube'\n] as const;\n\nexport default streamlineIconNames;\n\nexport type StreamlineIconName = (typeof streamlineIconNames)[number];\n"]}
|
|
@@ -44,7 +44,7 @@ export const StyledMetaListItem = styled.li(({ wrapItems }) => {
|
|
|
44
44
|
});
|
|
45
45
|
const MetaList = forwardRef(function MetaList({ testId, items, wrapItems = true, ...restProps }, ref) {
|
|
46
46
|
const testIds = useTestIds(testId, getMetaListTestIds);
|
|
47
|
-
const roleAttrValue = items.length <= 1 ? '
|
|
47
|
+
const roleAttrValue = items.length <= 1 ? 'none' : undefined;
|
|
48
48
|
return (_jsx(Flex, { "data-testid": testIds.root, ...restProps, as: StyledMetaList, role: roleAttrValue, container: { colGap: 0.5, alignItems: 'center', wrap: wrapItems ? 'wrap' : 'nowrap' }, wrapItems: wrapItems, ref: ref, children: items.flatMap((item, i, arr) => item
|
|
49
49
|
? [
|
|
50
50
|
_jsx(Text, { as: StyledMetaListItem, variant: 'secondary', role: roleAttrValue, wrapItems: wrapItems, children: item }, `${i + 0}`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaList.js","sourceRoot":"","sources":["../../../src/components/MetaList/MetaList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAO3B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,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kB,EAEtB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,SAAS,YAEnB,IAAI,IALA,GAAG,CAAC,GAAG,CAAC,EAAE,CAMV;aACR,CAAC,MAAM,CACN,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC;gBAClB,CAAC,CAAC;oBACE,KAAC,IAAI,IACH,EAAE,EAAE,kBAAkB,uBAGtB,OAAO,EAAC,WAAW,wBADd,GAAG,CAAC,GAAG,CAAC,MAAM,CAId;iBACR;gBACH,CAAC,CAAC,EAAE,CACP;YACH,CAAC,CAAC,EAAE,CACP,GACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { ReactNode, Ref, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Text from '../Text';\nimport Flex from '../Flex';\nimport type {\n BaseProps,\n ForwardRefForwardPropsComponent,\n NoChildrenProp,\n TestIdProp\n} from '../../types';\nimport { useTestIds } from '../../hooks';\nimport { withTestIds } from '../../utils';\n\nimport { getMetaListTestIds } from './MetaList.test-ids';\n\nexport interface MetaListProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** Array of nodes or text to be rendered in the list. */\n items: ReactNode[];\n /**\n * If true, MetaList items that extend past the MetaList's container will wrap to a new line.\n * @default true\n */\n wrapItems?: boolean;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLUListElement>;\n}\n\nexport const StyledMetaList = styled.ul<{ wrapItems: boolean }>(({ wrapItems }) => {\n return css`\n list-style: none;\n overflow: hidden;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n\n ${!wrapItems &&\n css`\n white-space: nowrap;\n `}\n `;\n});\n\nexport const StyledMetaListItem = styled.li<{ wrapItems: boolean }>(({ wrapItems }) => {\n return css`\n min-width: 0;\n display: inline-block;\n\n ${wrapItems\n ? css`\n overflow-wrap: break-word;\n `\n : css`\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n `}\n\n &[role='separator'] {\n -webkit-user-select: none;\n user-select: none;\n }\n `;\n});\n\nconst MetaList: ForwardRefForwardPropsComponent<MetaListProps> = forwardRef(function MetaList(\n { testId, items, wrapItems = true, ...restProps }: PropsWithoutRef<MetaListProps>,\n ref: MetaListProps['ref']\n) {\n const testIds = useTestIds(testId, getMetaListTestIds);\n const roleAttrValue = items.length <= 1 ? 'none' : undefined;\n\n return (\n <Flex\n data-testid={testIds.root}\n {...restProps}\n as={StyledMetaList}\n role={roleAttrValue}\n container={{ colGap: 0.5, alignItems: 'center', wrap: wrapItems ? 'wrap' : 'nowrap' }}\n wrapItems={wrapItems}\n ref={ref}\n >\n {items.flatMap((item, i, arr) =>\n item\n ? [\n <Text\n as={StyledMetaListItem}\n key={`${i + 0}`}\n variant='secondary'\n role={roleAttrValue}\n wrapItems={wrapItems}\n >\n {item}\n </Text>\n ].concat(\n i !== arr.length - 1\n ? [\n <Text\n as={StyledMetaListItem}\n aria-hidden\n key={`${i + 0}-sep`}\n variant='secondary'\n >\n •\n </Text>\n ]\n : []\n )\n : []\n )}\n </Flex>\n );\n});\n\nexport default withTestIds(MetaList, getMetaListTestIds);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Popover.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,yGAW9B,CAAC;AAIF,eAAO,MAAM,aAAa;aAAyB,MAAM;aAAW,OAAO;SA+H1E,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { defaultThemeProp } from '../../theme';
|
|
3
|
+
import { animations } from '../../styles';
|
|
3
4
|
export const StyledPopoverArrow = styled.div `
|
|
4
5
|
background-color: inherit;
|
|
5
6
|
|
|
@@ -13,7 +14,7 @@ export const StyledPopoverArrow = styled.div `
|
|
|
13
14
|
}
|
|
14
15
|
`;
|
|
15
16
|
StyledPopoverArrow.defaultProps = defaultThemeProp;
|
|
16
|
-
export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': borderRadius, 'z-index': { popover: popoverZIndex, backdrop: backdropZIndex }, shadow: { high }, palette }, components: { 'form-control': { 'border-radius': formControlBorderRadius }, popover: { background: popoverBackground } } }, portal, offset }) => {
|
|
17
|
+
export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': borderRadius, 'z-index': { popover: popoverZIndex, backdrop: backdropZIndex }, shadow: { high }, palette, animation }, components: { 'form-control': { 'border-radius': formControlBorderRadius }, popover: { background: popoverBackground } } }, portal, offset }) => {
|
|
17
18
|
return css `
|
|
18
19
|
/*
|
|
19
20
|
Margin should never be used with Popper.
|
|
@@ -25,12 +26,19 @@ export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': bor
|
|
|
25
26
|
border-radius: calc(${formControlBorderRadius} * ${borderRadius});
|
|
26
27
|
box-shadow: ${high};
|
|
27
28
|
color: ${palette['foreground-color']};
|
|
29
|
+
${animations.subProperties}
|
|
30
|
+
--scale-in-size: 1;
|
|
31
|
+
--animation-duration: calc(2 * ${animation.speed});
|
|
32
|
+
|
|
28
33
|
&[data-popper-reference-hidden='true'] {
|
|
29
34
|
visibility: hidden;
|
|
30
35
|
pointer-events: none;
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
&[data-popper-placement^='top'] {
|
|
39
|
+
transform-origin: center bottom;
|
|
40
|
+
animation-name: ${animations.reveal}, ${animations.slideInYEnd}, ${animations.scaleIn};
|
|
41
|
+
|
|
34
42
|
> ${StyledPopoverArrow} {
|
|
35
43
|
top: calc(100%);
|
|
36
44
|
|
|
@@ -50,6 +58,9 @@ export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': bor
|
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
&[data-popper-placement^='bottom'] {
|
|
61
|
+
transform-origin: center top;
|
|
62
|
+
animation-name: ${animations.reveal}, ${animations.slideInYStart}, ${animations.scaleIn};
|
|
63
|
+
|
|
53
64
|
> ${StyledPopoverArrow} {
|
|
54
65
|
bottom: calc(100%);
|
|
55
66
|
|
|
@@ -69,6 +80,9 @@ export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': bor
|
|
|
69
80
|
}
|
|
70
81
|
|
|
71
82
|
&[data-popper-placement^='right'] {
|
|
83
|
+
transform-origin: left center;
|
|
84
|
+
animation-name: ${animations.reveal}, ${animations.slideInXStart}, ${animations.scaleIn};
|
|
85
|
+
|
|
72
86
|
> ${StyledPopoverArrow} {
|
|
73
87
|
right: calc(100%);
|
|
74
88
|
|
|
@@ -88,6 +102,9 @@ export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': bor
|
|
|
88
102
|
}
|
|
89
103
|
|
|
90
104
|
&[data-popper-placement^='left'] {
|
|
105
|
+
transform-origin: right center;
|
|
106
|
+
animation-name: ${animations.reveal}, ${animations.slideInXEnd}, ${animations.scaleIn};
|
|
107
|
+
|
|
91
108
|
> ${StyledPopoverArrow} {
|
|
92
109
|
left: calc(100%);
|
|
93
110
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.styles.js","sourceRoot":"","sources":["../../../src/components/Popover/Popover.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Popover.styles.js","sourceRoot":"","sources":["../../../src/components/Popover/Popover.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAA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K,UAAU,CAAC,aAAa,KAAK,UAAU,CAAC,OAAO;;YAEnF,kBAAkB;;;;8CAIgB,YAAY;;;;;;;mBAOvC,MAAM;mBACN,MAAM;;;;;;;;0BAQC,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC,OAAO;;YAEjF,kBAAkB;;;;4CAIc,YAAY;;;;;;;mBAOrC,MAAM;oBACL,MAAM;;;;;KAKrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { animations } from '../../styles';\n\nexport const StyledPopoverArrow = styled.div`\n background-color: inherit;\n\n ::before {\n content: '';\n display: block;\n position: absolute;\n inset: -0.25rem;\n background-color: inherit;\n transform: rotate(45deg);\n }\n`;\n\nStyledPopoverArrow.defaultProps = defaultThemeProp;\n\nexport const StyledPopover = styled.div<{ offset?: number; portal?: boolean }>(\n ({\n theme: {\n base: {\n 'border-radius': borderRadius,\n 'z-index': { popover: popoverZIndex, backdrop: backdropZIndex },\n shadow: { high },\n palette,\n animation\n },\n components: {\n 'form-control': { 'border-radius': formControlBorderRadius },\n popover: { background: popoverBackground }\n }\n },\n portal,\n offset\n }) => {\n return css`\n /*\n Margin should never be used with Popper.\n https://popper.js.org/docs/v2/migration-guide/#4-remove-all-css-margins\n */\n margin: 0 !important;\n z-index: ${portal ? backdropZIndex - 1 : popoverZIndex};\n background: ${popoverBackground};\n border-radius: calc(${formControlBorderRadius} * ${borderRadius});\n box-shadow: ${high};\n color: ${palette['foreground-color']};\n ${animations.subProperties}\n --scale-in-size: 1;\n --animation-duration: calc(2 * ${animation.speed});\n\n &[data-popper-reference-hidden='true'] {\n visibility: hidden;\n pointer-events: none;\n }\n\n &[data-popper-placement^='top'] {\n transform-origin: center bottom;\n animation-name: ${animations.reveal}, ${animations.slideInYEnd}, ${animations.scaleIn};\n\n > ${StyledPopoverArrow} {\n top: calc(100%);\n\n ::before {\n border-bottom-right-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n height: ${offset}px;\n bottom: -${offset}px;\n left: 0;\n right: 0;\n }\n }\n\n &[data-popper-placement^='bottom'] {\n transform-origin: center top;\n animation-name: ${animations.reveal}, ${animations.slideInYStart}, ${animations.scaleIn};\n\n > ${StyledPopoverArrow} {\n bottom: calc(100%);\n\n ::before {\n border-top-left-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n height: ${offset}px;\n top: -${offset}px;\n left: 0;\n right: 0;\n }\n }\n\n &[data-popper-placement^='right'] {\n transform-origin: left center;\n animation-name: ${animations.reveal}, ${animations.slideInXStart}, ${animations.scaleIn};\n\n > ${StyledPopoverArrow} {\n right: calc(100%);\n\n ::before {\n border-bottom-left-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n width: ${offset}px;\n left: -${offset}px;\n top: 0;\n bottom: 0;\n }\n }\n\n &[data-popper-placement^='left'] {\n transform-origin: right center;\n animation-name: ${animations.reveal}, ${animations.slideInXEnd}, ${animations.scaleIn};\n\n > ${StyledPopoverArrow} {\n left: calc(100%);\n\n ::before {\n border-top-right-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n width: ${offset}px;\n right: -${offset}px;\n top: 0;\n bottom: 0;\n }\n }\n `;\n }\n);\n\nStyledPopover.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/modifiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAQlD,CAAC;AAIH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/modifiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAQlD,CAAC;AAIH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAsBxD,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAkK9D,CAAC"}
|
|
@@ -15,10 +15,20 @@ export const fitToContent = Object.freeze({
|
|
|
15
15
|
phase: 'beforeWrite',
|
|
16
16
|
requires: ['computeStyles', 'offset'],
|
|
17
17
|
fn({ state }) {
|
|
18
|
+
if (state.elements.popper.dataset.initialized !== 'true') {
|
|
19
|
+
state.elements.popper.style.visibility = 'hidden';
|
|
20
|
+
}
|
|
18
21
|
state.styles.popper.width = 'fit-content';
|
|
19
22
|
// Ideally, we would use `content-width.md` from the theme, but we can't access it outside of a React function component
|
|
20
23
|
state.elements.popper.style.maxWidth = '60ch';
|
|
21
24
|
state.elements.popper.style.minWidth = `${state.rects.reference.width}px`;
|
|
25
|
+
state.elements.popper.style.visibility = 'visible';
|
|
26
|
+
state.elements.popper.dataset.initialized = 'true';
|
|
27
|
+
},
|
|
28
|
+
effect({ instance }) {
|
|
29
|
+
requestAnimationFrame(() => {
|
|
30
|
+
instance.update();
|
|
31
|
+
});
|
|
22
32
|
}
|
|
23
33
|
});
|
|
24
34
|
export const placeAndContain = Object.freeze({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modifiers.js","sourceRoot":"","sources":["../../../src/components/Popover/modifiers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAExF,MAA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K,MAAM,IAAI,iBAAiB,KAAK,OAAO,EAAE,CAAC;YAClE,gBAAgB,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;QACvD,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,gBAAgB,IAAI,CAAC;QAEhE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,eAAe,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAE9F,iBAAiB,GAAG,GAAG,iBAAiB,GACtC,CAAC,2BAA2B,CAAC,CAAC,CAAC,IAAI,2BAA2B,EAAE,CAAC,CAAC,CAAC,EAAE,CAIvE,EAAE,CAAC;QAEH,IAAI,KAAK,CAAC,SAAS,KAAK,iBAAiB,EAAE,CAAC;YAC1C,KAAK,CAAC,SAAS,GAAG,iBAAiB,CAAC;YACpC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { Modifier } from '@popperjs/core';\n\nimport { documentIsAvailable, getScrollbarWidth, testElForOverflow } from '../../utils';\n\nexport const sameWidth: Modifier<'sameWidth', object> = Object.freeze({\n name: 'sameWidth',\n enabled: true,\n phase: 'beforeWrite',\n fn({ state }) {\n state.styles.popper.width = `${state.rects.reference.width}px`;\n },\n requires: ['computeStyles']\n});\n\nconst scrollbarSize = documentIsAvailable ? getScrollbarWidth() : 0;\n\nexport const fitToContent: Modifier<'fitToContent', object> = Object.freeze({\n name: 'fitToContent',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles', 'offset'],\n fn({ state }) {\n state.styles.popper.width = 'fit-content';\n // Ideally, we would use `content-width.md` from the theme, but we can't access it outside of a React function component\n state.elements.popper.style.maxWidth = '60ch';\n state.elements.popper.style.minWidth = `${state.rects.reference.width}px`;\n }\n});\n\nexport const placeAndContain: Modifier<'placeAndContain', object> = Object.freeze({\n name: 'placeAndContain',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles', 'offset'],\n fn: ({ state }) => {\n const [requestedPrimaryPlacement, requestedSecondaryPlacement] = state.placement.split('-') as [\n primaryPlacement: 'top' | 'bottom' | 'left' | 'right' | 'auto',\n secondaryPlacement?: 'start' | 'end' | undefined\n ];\n\n const padding = {\n top: 0,\n bottom: 0,\n right: 0,\n left: 0\n };\n\n const preventOverflowPad = state.orderedModifiers.find(({ name }) => name === 'preventOverflow')\n ?.options?.padding;\n\n if (typeof preventOverflowPad === 'number') {\n padding.top = preventOverflowPad;\n padding.bottom = preventOverflowPad;\n padding.right = preventOverflowPad;\n padding.left = preventOverflowPad;\n } else if (preventOverflowPad) {\n padding.top = preventOverflowPad.top ?? padding.top;\n padding.bottom = preventOverflowPad.bottom ?? padding.bottom;\n padding.right = preventOverflowPad.right ?? padding.right;\n padding.left = preventOverflowPad.left ?? padding.left;\n }\n\n const vw = document.documentElement.clientWidth;\n const vh = document.documentElement.clientHeight;\n\n const targetRect = state.rects.reference;\n const targetRectXStart = targetRect.x;\n const targetRectXEnd = targetRectXStart + targetRect.width;\n const targetRectYStart = targetRect.y;\n const targetRectYEnd = targetRectYStart + targetRect.height;\n const targetXMid = (targetRectXStart + targetRectXEnd) / 2;\n const targetYMid = (targetRectYStart + targetRectYEnd) / 2;\n const targetIsInLeftHalfOfViewport = targetXMid < vw / 2;\n const targetIsInTopHalfOfViewport = targetYMid < vh / 2;\n\n const offsetFromTargetX = state.modifiersData.offset?.[state.placement]?.x ?? 0;\n const offsetFromTargetY = state.modifiersData.offset?.[state.placement]?.y ?? 0;\n\n let popoverMaxWidth: null | number = null;\n let popoverMaxHeight: null | number = null;\n\n // The elements whose natural content size should be measured to determine resolved placement\n const scrollableEls = [...state.elements.popper.children].flatMap(popoverChildEl => {\n // Default to measuring direct popover children unless they have measureable items declared within\n const elsToMeasure = popoverChildEl.querySelectorAll('[data-popover-scroll-el]');\n return elsToMeasure.length > 0 ? [...elsToMeasure] : popoverChildEl;\n });\n\n const totalScrollableChildHeight = scrollableEls.reduce((sum, el) => {\n if (el === state.elements.arrow) {\n return sum;\n }\n\n if (testElForOverflow(el)[0]) {\n return sum + el.scrollHeight + scrollbarSize;\n }\n\n return sum + el.scrollHeight;\n }, 0);\n\n const naturalPopoverHeight = Math.max(\n state.elements.popper.scrollHeight,\n totalScrollableChildHeight\n );\n\n const naturalPopoverWidth = Math.max(\n state.elements.popper.scrollWidth,\n ...Array.from(state.elements.popper.children).map(el => {\n if (el === state.elements.arrow) {\n return -Infinity;\n }\n\n if (testElForOverflow(el)[1]) {\n return el.scrollWidth + scrollbarSize;\n }\n\n return el.scrollWidth;\n })\n );\n\n let resolvedPlacement: `${'top' | 'bottom' | 'left' | 'right' | 'auto'}${\n | ''\n | '-start'\n | '-end'}` = requestedPrimaryPlacement;\n\n if (requestedPrimaryPlacement === 'bottom') {\n popoverMaxHeight = vh - targetRectYEnd - offsetFromTargetY - padding.bottom;\n\n if (\n // If the popover will overflow the viewport bottom\n targetRectYEnd + offsetFromTargetY + naturalPopoverHeight + padding.bottom >\n vh\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInTopHalfOfViewport ? 'bottom' : 'top';\n }\n } else if (requestedPrimaryPlacement === 'top') {\n popoverMaxHeight = targetRectYStart + offsetFromTargetY - padding.top;\n\n if (\n // If the popover will overflow the viewport top\n targetRectYStart + offsetFromTargetY - naturalPopoverHeight + padding.top <\n 0\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInTopHalfOfViewport ? 'bottom' : 'top';\n }\n } else if (requestedPrimaryPlacement === 'left') {\n popoverMaxWidth = targetRectXStart + offsetFromTargetX - padding.left;\n\n if (\n // If the popover will overflow the viewport left\n targetRectXStart + offsetFromTargetX - naturalPopoverWidth + padding.left <\n 0\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInLeftHalfOfViewport ? 'right' : 'left';\n }\n } else if (requestedPrimaryPlacement === 'right') {\n popoverMaxWidth = vw - targetRectXEnd - offsetFromTargetX - padding.right;\n\n if (\n // If the popover will overflow the viewport right\n targetRectXEnd + offsetFromTargetX + naturalPopoverWidth + padding.right >\n vw\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInLeftHalfOfViewport ? 'right' : 'left';\n }\n }\n\n if (resolvedPlacement === 'left' || resolvedPlacement === 'right') {\n popoverMaxHeight = vh - padding.top - padding.bottom;\n }\n\n state.elements.popper.style.maxHeight = `${popoverMaxHeight}px`;\n\n state.elements.popper.style.maxWidth = popoverMaxWidth !== null ? `${popoverMaxWidth}px` : '';\n\n resolvedPlacement = `${resolvedPlacement}${\n (requestedSecondaryPlacement ? `-${requestedSecondaryPlacement}` : '') as\n | ''\n | '-start'\n | '-end'\n }`;\n\n if (state.placement !== resolvedPlacement) {\n state.placement = resolvedPlacement;\n state.reset = true;\n }\n }\n});\n"]}
|
|
1
|
+
{"version":3,"file":"modifiers.js","sourceRoot":"","sources":["../../../src/components/Popover/modifiers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAExF,MAAM,CAAC,MAAM,SAAS,GAAkC,MAAM,CAAC,MAAM,CAAC;IACpE,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,aAAa;IACpB,EAAE,CAAC,EAAE,KAAK,EAAE;QACV,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IACjE,CAAC;IACD,QAAQ,EAAE,CAAC,eAAe,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,mBAAmB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpE,MAAM,CAA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H,CAAC;QAED,IAAI,iBAAiB,KAAK,MAAM,IAAI,iBAAiB,KAAK,OAAO,EAAE,CAAC;YAClE,gBAAgB,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;QACvD,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,gBAAgB,IAAI,CAAC;QAEhE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,eAAe,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAE9F,iBAAiB,GAAG,GAAG,iBAAiB,GACtC,CAAC,2BAA2B,CAAC,CAAC,CAAC,IAAI,2BAA2B,EAAE,CAAC,CAAC,CAAC,EAAE,CAIvE,EAAE,CAAC;QAEH,IAAI,KAAK,CAAC,SAAS,KAAK,iBAAiB,EAAE,CAAC;YAC1C,KAAK,CAAC,SAAS,GAAG,iBAAiB,CAAC;YACpC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { Modifier } from '@popperjs/core';\n\nimport { documentIsAvailable, getScrollbarWidth, testElForOverflow } from '../../utils';\n\nexport const sameWidth: Modifier<'sameWidth', object> = Object.freeze({\n name: 'sameWidth',\n enabled: true,\n phase: 'beforeWrite',\n fn({ state }) {\n state.styles.popper.width = `${state.rects.reference.width}px`;\n },\n requires: ['computeStyles']\n});\n\nconst scrollbarSize = documentIsAvailable ? getScrollbarWidth() : 0;\n\nexport const fitToContent: Modifier<'fitToContent', object> = Object.freeze({\n name: 'fitToContent',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles', 'offset'],\n fn({ state }) {\n if (state.elements.popper.dataset.initialized !== 'true') {\n state.elements.popper.style.visibility = 'hidden';\n }\n state.styles.popper.width = 'fit-content';\n // Ideally, we would use `content-width.md` from the theme, but we can't access it outside of a React function component\n state.elements.popper.style.maxWidth = '60ch';\n state.elements.popper.style.minWidth = `${state.rects.reference.width}px`;\n\n state.elements.popper.style.visibility = 'visible';\n state.elements.popper.dataset.initialized = 'true';\n },\n effect({ instance }) {\n requestAnimationFrame(() => {\n instance.update();\n });\n }\n});\n\nexport const placeAndContain: Modifier<'placeAndContain', object> = Object.freeze({\n name: 'placeAndContain',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles', 'offset'],\n fn: ({ state }) => {\n const [requestedPrimaryPlacement, requestedSecondaryPlacement] = state.placement.split('-') as [\n primaryPlacement: 'top' | 'bottom' | 'left' | 'right' | 'auto',\n secondaryPlacement?: 'start' | 'end' | undefined\n ];\n\n const padding = {\n top: 0,\n bottom: 0,\n right: 0,\n left: 0\n };\n\n const preventOverflowPad = state.orderedModifiers.find(({ name }) => name === 'preventOverflow')\n ?.options?.padding;\n\n if (typeof preventOverflowPad === 'number') {\n padding.top = preventOverflowPad;\n padding.bottom = preventOverflowPad;\n padding.right = preventOverflowPad;\n padding.left = preventOverflowPad;\n } else if (preventOverflowPad) {\n padding.top = preventOverflowPad.top ?? padding.top;\n padding.bottom = preventOverflowPad.bottom ?? padding.bottom;\n padding.right = preventOverflowPad.right ?? padding.right;\n padding.left = preventOverflowPad.left ?? padding.left;\n }\n\n const vw = document.documentElement.clientWidth;\n const vh = document.documentElement.clientHeight;\n\n const targetRect = state.rects.reference;\n const targetRectXStart = targetRect.x;\n const targetRectXEnd = targetRectXStart + targetRect.width;\n const targetRectYStart = targetRect.y;\n const targetRectYEnd = targetRectYStart + targetRect.height;\n const targetXMid = (targetRectXStart + targetRectXEnd) / 2;\n const targetYMid = (targetRectYStart + targetRectYEnd) / 2;\n const targetIsInLeftHalfOfViewport = targetXMid < vw / 2;\n const targetIsInTopHalfOfViewport = targetYMid < vh / 2;\n\n const offsetFromTargetX = state.modifiersData.offset?.[state.placement]?.x ?? 0;\n const offsetFromTargetY = state.modifiersData.offset?.[state.placement]?.y ?? 0;\n\n let popoverMaxWidth: null | number = null;\n let popoverMaxHeight: null | number = null;\n\n // The elements whose natural content size should be measured to determine resolved placement\n const scrollableEls = [...state.elements.popper.children].flatMap(popoverChildEl => {\n // Default to measuring direct popover children unless they have measureable items declared within\n const elsToMeasure = popoverChildEl.querySelectorAll('[data-popover-scroll-el]');\n return elsToMeasure.length > 0 ? [...elsToMeasure] : popoverChildEl;\n });\n\n const totalScrollableChildHeight = scrollableEls.reduce((sum, el) => {\n if (el === state.elements.arrow) {\n return sum;\n }\n\n if (testElForOverflow(el)[0]) {\n return sum + el.scrollHeight + scrollbarSize;\n }\n\n return sum + el.scrollHeight;\n }, 0);\n\n const naturalPopoverHeight = Math.max(\n state.elements.popper.scrollHeight,\n totalScrollableChildHeight\n );\n\n const naturalPopoverWidth = Math.max(\n state.elements.popper.scrollWidth,\n ...Array.from(state.elements.popper.children).map(el => {\n if (el === state.elements.arrow) {\n return -Infinity;\n }\n\n if (testElForOverflow(el)[1]) {\n return el.scrollWidth + scrollbarSize;\n }\n\n return el.scrollWidth;\n })\n );\n\n let resolvedPlacement: `${'top' | 'bottom' | 'left' | 'right' | 'auto'}${\n | ''\n | '-start'\n | '-end'}` = requestedPrimaryPlacement;\n\n if (requestedPrimaryPlacement === 'bottom') {\n popoverMaxHeight = vh - targetRectYEnd - offsetFromTargetY - padding.bottom;\n\n if (\n // If the popover will overflow the viewport bottom\n targetRectYEnd + offsetFromTargetY + naturalPopoverHeight + padding.bottom >\n vh\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInTopHalfOfViewport ? 'bottom' : 'top';\n }\n } else if (requestedPrimaryPlacement === 'top') {\n popoverMaxHeight = targetRectYStart + offsetFromTargetY - padding.top;\n\n if (\n // If the popover will overflow the viewport top\n targetRectYStart + offsetFromTargetY - naturalPopoverHeight + padding.top <\n 0\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInTopHalfOfViewport ? 'bottom' : 'top';\n }\n } else if (requestedPrimaryPlacement === 'left') {\n popoverMaxWidth = targetRectXStart + offsetFromTargetX - padding.left;\n\n if (\n // If the popover will overflow the viewport left\n targetRectXStart + offsetFromTargetX - naturalPopoverWidth + padding.left <\n 0\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInLeftHalfOfViewport ? 'right' : 'left';\n }\n } else if (requestedPrimaryPlacement === 'right') {\n popoverMaxWidth = vw - targetRectXEnd - offsetFromTargetX - padding.right;\n\n if (\n // If the popover will overflow the viewport right\n targetRectXEnd + offsetFromTargetX + naturalPopoverWidth + padding.right >\n vw\n ) {\n // Choose the side with most allowance\n resolvedPlacement = targetIsInLeftHalfOfViewport ? 'right' : 'left';\n }\n }\n\n if (resolvedPlacement === 'left' || resolvedPlacement === 'right') {\n popoverMaxHeight = vh - padding.top - padding.bottom;\n }\n\n state.elements.popper.style.maxHeight = `${popoverMaxHeight}px`;\n\n state.elements.popper.style.maxWidth = popoverMaxWidth !== null ? `${popoverMaxWidth}px` : '';\n\n resolvedPlacement = `${resolvedPlacement}${\n (requestedSecondaryPlacement ? `-${requestedSecondaryPlacement}` : '') as\n | ''\n | '-start'\n | '-end'\n }`;\n\n if (state.placement !== resolvedPlacement) {\n state.placement = resolvedPlacement;\n state.reset = true;\n }\n }\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqC,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG/E,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA+B,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG1F,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQtD,MAAM,WAAW,YAAa,SAAQ,SAAS,EAAE,UAAU;IACzD,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC;IACp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S,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACtC;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAClC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,yGAcxB,CAAC;;;;AA4LH,wBAAuD"}
|
|
@@ -15,9 +15,11 @@ export const StyledTooltip = styled.div(({ theme }) => {
|
|
|
15
15
|
color: ${theme.components.tooltip['foreground-color']};
|
|
16
16
|
font-size: ${fontSize.xxs};
|
|
17
17
|
max-width: 40ch;
|
|
18
|
-
padding: ${theme.base.spacing};
|
|
18
|
+
padding: calc(${theme.base.spacing} / 2);
|
|
19
19
|
white-space: pre-line;
|
|
20
20
|
word-break: break-word;
|
|
21
|
+
--scale-in-size: 0;
|
|
22
|
+
--animation-duration: ${theme.base.animation.speed};
|
|
21
23
|
`;
|
|
22
24
|
});
|
|
23
25
|
StyledTooltip.defaultProps = defaultThemeProp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,k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SAAS,EACb,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,WAAW,EAAE,GAAG,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,EACD,UAAU,EAAE,GAAG,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAC9C,MAAM,EAAE,MAAM,EACd,KAAK,QACL,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,kBAAkB,QAClB,GAAG,EAAE,UAAU,YAEd,QAAQ,GACD,GACI,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport type { MutableRefObject, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardRefForwardPropsComponent, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Popover from '../Popover';\nimport type { Delay, PopoverProps } from '../Popover';\nimport { useConsolidatedRef, useTestIds, useTheme, useUID } from '../../hooks';\nimport { calculateFontSize, readableHue } from '../../styles';\nimport { getActiveElement, mouseState, testElForOverflow, withTestIds } from '../../utils';\nimport { ThemeOverride } from '../Configuration';\n\nimport { getTooltipTestIds } from './Tooltip.test-ids';\n\nexport interface TooltipProps extends BaseProps, TestIdProp {\n /** Text content for the tooltip. */\n children: ReactNode;\n /** Element to serve as the tooltip's target. */\n target: Element | null;\n /** Elements to ignore from within the tooltip's target. */\n ignoredElements?: TooltipProps['target'][];\n /**\n * Delay showing the tooltip on mouseenter.\n * @default 'short'\n */\n showDelay?: Delay;\n /**\n * Delay hiding the tooltip on mouseleave.\n * @default 'long'\n */\n hideDelay?: Delay;\n /**\n * If true, the Tooltip will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default true\n */\n portal?: PopoverProps['portal'];\n /**\n * If true, the Tooltip will automatically apply an aria-describedby attribute to its target.\n * @default true\n */\n describeTarget?: boolean;\n /**\n * Sets the placement of the tooltip relative to the target.\n * @default 'bottom'\n */\n placement?: PopoverProps['placement'];\n /**\n * Conditionally renders a tooltip only if the associated element's (or its descendants) text content is truncated.\n * To work, the associated element must be be displayed as a CSS \"block box\" i.e. block, inline-block, etc...\n * @default false\n */\n smart?: boolean;\n /**\n * The group that the Popover belongs to. Popovers in the same group will be closed when others open.\n * @default 'tooltip'\n */\n groupId?: PopoverProps['groupId'];\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledTooltip = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n background-color: ${theme.components.tooltip['background-color']};\n color: ${theme.components.tooltip['foreground-color']};\n font-size: ${fontSize.xxs};\n max-width: 40ch;\n padding: ${theme.base.spacing};\n white-space: pre-line;\n word-break: break-word;\n `;\n});\n\nStyledTooltip.defaultProps = defaultThemeProp;\n\nconst Tooltip: ForwardRefForwardPropsComponent<TooltipProps> = forwardRef(function Tooltip(\n {\n testId,\n children,\n target,\n ignoredElements = [],\n showDelay = 'short',\n hideDelay = 'long',\n placement = 'top',\n describeTarget = true,\n smart,\n groupId = 'tooltip',\n ...restProps\n }: PropsWithoutRef<TooltipProps>,\n ref: TooltipProps['ref']\n) {\n const id = useUID();\n const [show, setShow] = useState(false);\n const [ignoreDelay, setIgnoreDelay] = useState(false);\n const tooltipRef = useConsolidatedRef(ref);\n const lastClickedRef: MutableRefObject<EventTarget | null> = useRef(null);\n const testIds = useTestIds(testId, getTooltipTestIds);\n\n const stringContentOnly =\n typeof children === 'string' ||\n (Array.isArray(children) && children.every(child => typeof child === 'string'));\n\n const onMouseDown = useCallback(\n ({ target: eTarget }: MouseEvent) => {\n lastClickedRef.current = eTarget;\n if (eTarget === tooltipRef.current || eTarget === target) return;\n setShow(false);\n },\n [target]\n );\n\n useEffect(() => {\n if (!target) return;\n\n const showTooltip = () => {\n // This approach may result in a tooltip NOT appearing 1px before it should due to browser specifics. Enhance as needed.\n // https://stackoverflow.com/a/64747288\n\n const checkTruncation = (element: Element): boolean => {\n if (\n testElForOverflow(element).some(Boolean) &&\n !['absolute', 'fixed'].includes(window.getComputedStyle(element).position)\n )\n return true;\n\n for (const child of element.children) {\n if (checkTruncation(child)) return true;\n }\n\n return false;\n };\n\n setShow(smart ? checkTruncation(target) : true);\n };\n\n const onFocusIn = () => {\n showTooltip();\n };\n\n const onFocusOut = () => {\n if (!lastClickedRef.current || lastClickedRef.current !== tooltipRef.current) {\n setShow(false);\n }\n lastClickedRef.current = null;\n };\n\n const onMouseEnter = () => {\n if (ignoredElements.some(exclusion => exclusion?.matches(':hover')) || mouseState.primary) {\n return;\n }\n\n showTooltip();\n };\n\n const onMouseLeave = () => {\n if (getActiveElement() !== target) {\n setShow(false);\n }\n };\n\n const onKeyDown = ({ key }: KeyboardEvent) => {\n if (key === 'Escape' && show) {\n setIgnoreDelay(true);\n setShow(false);\n }\n };\n\n document.addEventListener('keydown', onKeyDown);\n document.addEventListener('mousedown', onMouseDown);\n\n target.addEventListener('focusin', onFocusIn);\n target.addEventListener('focusout', onFocusOut);\n target.addEventListener('mouseenter', onMouseEnter);\n target.addEventListener('mouseleave', onMouseLeave);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('mousedown', onMouseDown);\n\n target.removeEventListener('focusin', onFocusIn);\n target.removeEventListener('focusout', onFocusOut);\n target.removeEventListener('mouseenter', onMouseEnter);\n target.removeEventListener('mouseleave', onMouseLeave);\n };\n }, [target, onMouseDown, smart, show]);\n\n useEffect(() => {\n if (target && describeTarget && show) {\n const describedBy = target.getAttribute('aria-describedby');\n // Set the attribute to the old attribute plus the id\n target.setAttribute('aria-describedby', describedBy ? `${describedBy} ${id}` : id);\n } else if (target) {\n // Get the old attribute\n const describedBy = target.getAttribute('aria-describedby');\n if (describedBy) {\n // If the old attribute matches the id just remove it entirely\n if (describedBy === id) {\n target.removeAttribute('aria-describedby');\n } else {\n // Otherwise we want to just remove the id that was added and reset the attribute to what it was before\n const oldDescribedBy = describedBy.replace(new RegExp(`(?:^|\\\\s+)${id}`), '');\n target.setAttribute('aria-describedby', oldDescribedBy);\n }\n }\n }\n }, [describeTarget, target, show]);\n\n useEffect(() => {\n if (!show && ignoreDelay) {\n setIgnoreDelay(false);\n }\n }, [show, ignoreDelay]);\n\n const theme = useTheme();\n const tooltipTheme = {\n base: {\n palette: {\n 'primary-background': theme.components.tooltip['background-color'],\n 'foreground-color': theme.components.tooltip['foreground-color'],\n interactive: readableHue(\n theme.base.palette.interactive,\n theme.components.tooltip['background-color']\n )\n }\n }\n };\n\n return (\n <ThemeOverride theme={tooltipTheme}>\n <Popover\n data-testid={testIds.root}\n id={id}\n groupId={groupId}\n {...restProps}\n show={show}\n showDelay={ignoreDelay ? 'none' : showDelay}\n hideDelay={ignoreDelay ? 'none' : hideDelay}\n onMouseOver={() => {\n setShow(true);\n }}\n onMouseOut={() => {\n setShow(false);\n }}\n strategy='fixed'\n as={StyledTooltip}\n role={stringContentOnly ? 'tooltip' : 'dialog'}\n target={target}\n arrow\n placement={placement}\n onMouseDown={onMouseDown}\n hideOnTargetHidden\n ref={tooltipRef}\n >\n {children}\n </Popover>\n </ThemeOverride>\n );\n});\n\nexport default withTestIds(Tooltip, getTooltipTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW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AW,CACtB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAC9B,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAC7C;aACF;SACF;KACF,CAAC;IAEF,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,YAChC,KAAC,OAAO,mBACO,OAAO,CAAC,IAAI,EACzB,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,KACZ,SAAS,EACb,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,WAAW,EAAE,GAAG,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,EACD,UAAU,EAAE,GAAG,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAC9C,MAAM,EAAE,MAAM,EACd,KAAK,QACL,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,kBAAkB,QAClB,GAAG,EAAE,UAAU,YAEd,QAAQ,GACD,GACI,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport type { MutableRefObject, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardRefForwardPropsComponent, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Popover from '../Popover';\nimport type { Delay, PopoverProps } from '../Popover';\nimport { useConsolidatedRef, useTestIds, useTheme, useUID } from '../../hooks';\nimport { calculateFontSize, readableHue } from '../../styles';\nimport { getActiveElement, mouseState, testElForOverflow, withTestIds } from '../../utils';\nimport { ThemeOverride } from '../Configuration';\n\nimport { getTooltipTestIds } from './Tooltip.test-ids';\n\nexport interface TooltipProps extends BaseProps, TestIdProp {\n /** Text content for the tooltip. */\n children: ReactNode;\n /** Element to serve as the tooltip's target. */\n target: Element | null;\n /** Elements to ignore from within the tooltip's target. */\n ignoredElements?: TooltipProps['target'][];\n /**\n * Delay showing the tooltip on mouseenter.\n * @default 'short'\n */\n showDelay?: Delay;\n /**\n * Delay hiding the tooltip on mouseleave.\n * @default 'long'\n */\n hideDelay?: Delay;\n /**\n * If true, the Tooltip will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default true\n */\n portal?: PopoverProps['portal'];\n /**\n * If true, the Tooltip will automatically apply an aria-describedby attribute to its target.\n * @default true\n */\n describeTarget?: boolean;\n /**\n * Sets the placement of the tooltip relative to the target.\n * @default 'bottom'\n */\n placement?: PopoverProps['placement'];\n /**\n * Conditionally renders a tooltip only if the associated element's (or its descendants) text content is truncated.\n * To work, the associated element must be be displayed as a CSS \"block box\" i.e. block, inline-block, etc...\n * @default false\n */\n smart?: boolean;\n /**\n * The group that the Popover belongs to. Popovers in the same group will be closed when others open.\n * @default 'tooltip'\n */\n groupId?: PopoverProps['groupId'];\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledTooltip = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n background-color: ${theme.components.tooltip['background-color']};\n color: ${theme.components.tooltip['foreground-color']};\n font-size: ${fontSize.xxs};\n max-width: 40ch;\n padding: calc(${theme.base.spacing} / 2);\n white-space: pre-line;\n word-break: break-word;\n --scale-in-size: 0;\n --animation-duration: ${theme.base.animation.speed};\n `;\n});\n\nStyledTooltip.defaultProps = defaultThemeProp;\n\nconst Tooltip: ForwardRefForwardPropsComponent<TooltipProps> = forwardRef(function Tooltip(\n {\n testId,\n children,\n target,\n ignoredElements = [],\n showDelay = 'short',\n hideDelay = 'long',\n placement = 'top',\n describeTarget = true,\n smart,\n groupId = 'tooltip',\n ...restProps\n }: PropsWithoutRef<TooltipProps>,\n ref: TooltipProps['ref']\n) {\n const id = useUID();\n const [show, setShow] = useState(false);\n const [ignoreDelay, setIgnoreDelay] = useState(false);\n const tooltipRef = useConsolidatedRef(ref);\n const lastClickedRef: MutableRefObject<EventTarget | null> = useRef(null);\n const testIds = useTestIds(testId, getTooltipTestIds);\n\n const stringContentOnly =\n typeof children === 'string' ||\n (Array.isArray(children) && children.every(child => typeof child === 'string'));\n\n const onMouseDown = useCallback(\n ({ target: eTarget }: MouseEvent) => {\n lastClickedRef.current = eTarget;\n if (eTarget === tooltipRef.current || eTarget === target) return;\n setShow(false);\n },\n [target]\n );\n\n useEffect(() => {\n if (!target) return;\n\n const showTooltip = () => {\n // This approach may result in a tooltip NOT appearing 1px before it should due to browser specifics. Enhance as needed.\n // https://stackoverflow.com/a/64747288\n\n const checkTruncation = (element: Element): boolean => {\n if (\n testElForOverflow(element).some(Boolean) &&\n !['absolute', 'fixed'].includes(window.getComputedStyle(element).position)\n )\n return true;\n\n for (const child of element.children) {\n if (checkTruncation(child)) return true;\n }\n\n return false;\n };\n\n setShow(smart ? checkTruncation(target) : true);\n };\n\n const onFocusIn = () => {\n showTooltip();\n };\n\n const onFocusOut = () => {\n if (!lastClickedRef.current || lastClickedRef.current !== tooltipRef.current) {\n setShow(false);\n }\n lastClickedRef.current = null;\n };\n\n const onMouseEnter = () => {\n if (ignoredElements.some(exclusion => exclusion?.matches(':hover')) || mouseState.primary) {\n return;\n }\n\n showTooltip();\n };\n\n const onMouseLeave = () => {\n if (getActiveElement() !== target) {\n setShow(false);\n }\n };\n\n const onKeyDown = ({ key }: KeyboardEvent) => {\n if (key === 'Escape' && show) {\n setIgnoreDelay(true);\n setShow(false);\n }\n };\n\n document.addEventListener('keydown', onKeyDown);\n document.addEventListener('mousedown', onMouseDown);\n\n target.addEventListener('focusin', onFocusIn);\n target.addEventListener('focusout', onFocusOut);\n target.addEventListener('mouseenter', onMouseEnter);\n target.addEventListener('mouseleave', onMouseLeave);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('mousedown', onMouseDown);\n\n target.removeEventListener('focusin', onFocusIn);\n target.removeEventListener('focusout', onFocusOut);\n target.removeEventListener('mouseenter', onMouseEnter);\n target.removeEventListener('mouseleave', onMouseLeave);\n };\n }, [target, onMouseDown, smart, show]);\n\n useEffect(() => {\n if (target && describeTarget && show) {\n const describedBy = target.getAttribute('aria-describedby');\n // Set the attribute to the old attribute plus the id\n target.setAttribute('aria-describedby', describedBy ? `${describedBy} ${id}` : id);\n } else if (target) {\n // Get the old attribute\n const describedBy = target.getAttribute('aria-describedby');\n if (describedBy) {\n // If the old attribute matches the id just remove it entirely\n if (describedBy === id) {\n target.removeAttribute('aria-describedby');\n } else {\n // Otherwise we want to just remove the id that was added and reset the attribute to what it was before\n const oldDescribedBy = describedBy.replace(new RegExp(`(?:^|\\\\s+)${id}`), '');\n target.setAttribute('aria-describedby', oldDescribedBy);\n }\n }\n }\n }, [describeTarget, target, show]);\n\n useEffect(() => {\n if (!show && ignoreDelay) {\n setIgnoreDelay(false);\n }\n }, [show, ignoreDelay]);\n\n const theme = useTheme();\n const tooltipTheme = {\n base: {\n palette: {\n 'primary-background': theme.components.tooltip['background-color'],\n 'foreground-color': theme.components.tooltip['foreground-color'],\n interactive: readableHue(\n theme.base.palette.interactive,\n theme.components.tooltip['background-color']\n )\n }\n }\n };\n\n return (\n <ThemeOverride theme={tooltipTheme}>\n <Popover\n data-testid={testIds.root}\n id={id}\n groupId={groupId}\n {...restProps}\n show={show}\n showDelay={ignoreDelay ? 'none' : showDelay}\n hideDelay={ignoreDelay ? 'none' : hideDelay}\n onMouseOver={() => {\n setShow(true);\n }}\n onMouseOut={() => {\n setShow(false);\n }}\n strategy='fixed'\n as={StyledTooltip}\n role={stringContentOnly ? 'tooltip' : 'dialog'}\n target={target}\n arrow\n placement={placement}\n onMouseDown={onMouseDown}\n hideOnTargetHidden\n ref={tooltipRef}\n >\n {children}\n </Popover>\n </ThemeOverride>\n );\n});\n\nexport default withTestIds(Tooltip, getTooltipTestIds);\n"]}
|