@primer/styled-react 0.0.0-20251202210025 → 0.0.0-20251202220556

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.
Files changed (110) hide show
  1. package/dist/_virtual/rolldown_runtime.js +29 -0
  2. package/dist/node_modules/clsx/dist/clsx.js +17 -0
  3. package/dist/node_modules/deepmerge/dist/cjs.js +88 -0
  4. package/dist/node_modules/focus-visible/dist/focus-visible.js +212 -0
  5. package/dist/packages/styled-react/src/components/ActionList.js +107 -0
  6. package/dist/packages/styled-react/src/components/ActionMenu.js +19 -0
  7. package/dist/packages/styled-react/src/components/Autocomplete.js +23 -0
  8. package/dist/packages/styled-react/src/components/Avatar.js +16 -0
  9. package/dist/{components → packages/styled-react/src/components}/BaseStyles.js +29 -47
  10. package/dist/packages/styled-react/src/components/Box.js +23 -0
  11. package/dist/packages/styled-react/src/components/Breadcrumbs.js +28 -0
  12. package/dist/packages/styled-react/src/components/Button.js +48 -0
  13. package/dist/packages/styled-react/src/components/Checkbox.js +17 -0
  14. package/dist/packages/styled-react/src/components/CheckboxGroup.js +41 -0
  15. package/dist/packages/styled-react/src/components/CircleBadge.js +12 -0
  16. package/dist/packages/styled-react/src/components/CounterLabel.js +16 -0
  17. package/dist/packages/styled-react/src/components/DataTable.js +24 -0
  18. package/dist/packages/styled-react/src/components/Dialog.js +64 -0
  19. package/dist/packages/styled-react/src/components/Flash.js +12 -0
  20. package/dist/packages/styled-react/src/components/FormControl.js +19 -0
  21. package/dist/packages/styled-react/src/components/Header.js +44 -0
  22. package/dist/packages/styled-react/src/components/Heading.js +12 -0
  23. package/dist/packages/styled-react/src/components/IconButton.js +27 -0
  24. package/dist/packages/styled-react/src/components/Label.js +21 -0
  25. package/dist/packages/styled-react/src/components/Link.js +21 -0
  26. package/dist/packages/styled-react/src/components/LinkButton.js +12 -0
  27. package/dist/packages/styled-react/src/components/NavList.js +55 -0
  28. package/dist/packages/styled-react/src/components/Overlay.js +12 -0
  29. package/dist/packages/styled-react/src/components/PageHeader.js +71 -0
  30. package/dist/packages/styled-react/src/components/RadioGroup.js +41 -0
  31. package/dist/packages/styled-react/src/components/RelativeTime.js +14 -0
  32. package/dist/packages/styled-react/src/components/SegmentedControl.js +33 -0
  33. package/dist/packages/styled-react/src/components/Select.js +19 -0
  34. package/dist/packages/styled-react/src/components/Spinner.js +12 -0
  35. package/dist/packages/styled-react/src/components/StateLabel.js +16 -0
  36. package/dist/packages/styled-react/src/components/SubNav.js +28 -0
  37. package/dist/packages/styled-react/src/components/Text.js +21 -0
  38. package/dist/packages/styled-react/src/components/TextInput.js +31 -0
  39. package/dist/packages/styled-react/src/components/Textarea.js +21 -0
  40. package/dist/packages/styled-react/src/components/ThemeProvider.js +152 -0
  41. package/dist/packages/styled-react/src/components/Timeline.js +49 -0
  42. package/dist/packages/styled-react/src/components/ToggleSwitch.js +16 -0
  43. package/dist/packages/styled-react/src/components/Token.js +21 -0
  44. package/dist/packages/styled-react/src/components/Tooltip.js +17 -0
  45. package/dist/packages/styled-react/src/components/Truncate.js +12 -0
  46. package/dist/packages/styled-react/src/components/UnderlineNav.js +33 -0
  47. package/dist/packages/styled-react/src/components/UnderlinePanels.js +23 -0
  48. package/dist/packages/styled-react/src/components/deprecated/ActionList.js +44 -0
  49. package/dist/packages/styled-react/src/components/deprecated/DialogV1.js +34 -0
  50. package/dist/packages/styled-react/src/components/deprecated/Octicon.js +32 -0
  51. package/dist/packages/styled-react/src/components/deprecated/TabNav.js +30 -0
  52. package/dist/packages/styled-react/src/components/deprecated/Tooltip.js +24 -0
  53. package/dist/packages/styled-react/src/deprecated.js +7 -0
  54. package/dist/packages/styled-react/src/experimental.js +7 -0
  55. package/dist/packages/styled-react/src/index.js +50 -0
  56. package/dist/packages/styled-react/src/sx.js +11 -0
  57. package/dist/packages/styled-react/src/theme-get.js +10 -0
  58. package/package.json +4 -4
  59. package/dist/components/ActionList.js +0 -163
  60. package/dist/components/ActionMenu.js +0 -19
  61. package/dist/components/Autocomplete.js +0 -25
  62. package/dist/components/Avatar.js +0 -14
  63. package/dist/components/Box.js +0 -15
  64. package/dist/components/Breadcrumbs.js +0 -38
  65. package/dist/components/Button.js +0 -112
  66. package/dist/components/Checkbox.js +0 -15
  67. package/dist/components/CheckboxGroup.js +0 -43
  68. package/dist/components/CircleBadge.js +0 -12
  69. package/dist/components/CounterLabel.js +0 -14
  70. package/dist/components/DataTable.js +0 -32
  71. package/dist/components/Dialog.js +0 -90
  72. package/dist/components/Flash.js +0 -12
  73. package/dist/components/FormControl.js +0 -19
  74. package/dist/components/Header.js +0 -52
  75. package/dist/components/Heading.js +0 -12
  76. package/dist/components/IconButton.js +0 -40
  77. package/dist/components/Label.js +0 -26
  78. package/dist/components/Link.js +0 -26
  79. package/dist/components/LinkButton.js +0 -12
  80. package/dist/components/NavList.js +0 -74
  81. package/dist/components/Overlay.js +0 -12
  82. package/dist/components/PageHeader.js +0 -109
  83. package/dist/components/RadioGroup.js +0 -43
  84. package/dist/components/RelativeTime.js +0 -14
  85. package/dist/components/SegmentedControl.js +0 -31
  86. package/dist/components/Select.js +0 -24
  87. package/dist/components/Spinner.js +0 -12
  88. package/dist/components/StateLabel.js +0 -14
  89. package/dist/components/SubNav.js +0 -26
  90. package/dist/components/Text.js +0 -26
  91. package/dist/components/TextInput.js +0 -38
  92. package/dist/components/Textarea.js +0 -26
  93. package/dist/components/ThemeProvider.js +0 -203
  94. package/dist/components/Timeline.js +0 -47
  95. package/dist/components/ToggleSwitch.js +0 -14
  96. package/dist/components/Token.js +0 -26
  97. package/dist/components/Tooltip.js +0 -15
  98. package/dist/components/Truncate.js +0 -12
  99. package/dist/components/UnderlineNav.js +0 -45
  100. package/dist/components/UnderlinePanels.js +0 -28
  101. package/dist/components/deprecated/ActionList.js +0 -49
  102. package/dist/components/deprecated/DialogV1.js +0 -44
  103. package/dist/components/deprecated/Octicon.js +0 -39
  104. package/dist/components/deprecated/TabNav.js +0 -44
  105. package/dist/components/deprecated/Tooltip.js +0 -32
  106. package/dist/deprecated.js +0 -5
  107. package/dist/experimental.js +0 -5
  108. package/dist/index.js +0 -46
  109. package/dist/sx.js +0 -8
  110. package/dist/theme-get.js +0 -10
@@ -0,0 +1,29 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) {
14
+ __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ }
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+
28
+ //#endregion
29
+ export { __commonJSMin, __toESM };
@@ -0,0 +1,17 @@
1
+ //#region ../../node_modules/clsx/dist/clsx.mjs
2
+ function r(e) {
3
+ var t, f, n = "";
4
+ if ("string" == typeof e || "number" == typeof e) n += e;
5
+ else if ("object" == typeof e) if (Array.isArray(e)) {
6
+ var o = e.length;
7
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
8
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
9
+ return n;
10
+ }
11
+ function clsx() {
12
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
13
+ return n;
14
+ }
15
+
16
+ //#endregion
17
+ export { clsx };
@@ -0,0 +1,88 @@
1
+ import { __commonJSMin } from "../../../_virtual/rolldown_runtime.js";
2
+
3
+ //#region ../../node_modules/deepmerge/dist/cjs.js
4
+ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
+ var isMergeableObject = function isMergeableObject$1(value) {
6
+ return isNonNullObject(value) && !isSpecial(value);
7
+ };
8
+ function isNonNullObject(value) {
9
+ return !!value && typeof value === "object";
10
+ }
11
+ function isSpecial(value) {
12
+ var stringValue = Object.prototype.toString.call(value);
13
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
14
+ }
15
+ var REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol.for ? Symbol.for("react.element") : 60103;
16
+ function isReactElement(value) {
17
+ return value.$$typeof === REACT_ELEMENT_TYPE;
18
+ }
19
+ function emptyTarget(val) {
20
+ return Array.isArray(val) ? [] : {};
21
+ }
22
+ function cloneUnlessOtherwiseSpecified(value, options) {
23
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
24
+ }
25
+ function defaultArrayMerge(target, source, options) {
26
+ return target.concat(source).map(function(element) {
27
+ return cloneUnlessOtherwiseSpecified(element, options);
28
+ });
29
+ }
30
+ function getMergeFunction(key, options) {
31
+ if (!options.customMerge) return deepmerge;
32
+ var customMerge = options.customMerge(key);
33
+ return typeof customMerge === "function" ? customMerge : deepmerge;
34
+ }
35
+ function getEnumerableOwnPropertySymbols(target) {
36
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
37
+ return Object.propertyIsEnumerable.call(target, symbol);
38
+ }) : [];
39
+ }
40
+ function getKeys(target) {
41
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
42
+ }
43
+ function propertyIsOnObject(object, property) {
44
+ try {
45
+ return property in object;
46
+ } catch (_) {
47
+ return false;
48
+ }
49
+ }
50
+ function propertyIsUnsafe(target, key) {
51
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
52
+ }
53
+ function mergeObject(target, source, options) {
54
+ var destination = {};
55
+ if (options.isMergeableObject(target)) getKeys(target).forEach(function(key) {
56
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
57
+ });
58
+ getKeys(source).forEach(function(key) {
59
+ if (propertyIsUnsafe(target, key)) return;
60
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
61
+ else destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
62
+ });
63
+ return destination;
64
+ }
65
+ function deepmerge(target, source, options) {
66
+ options = options || {};
67
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
68
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
69
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
70
+ var sourceIsArray = Array.isArray(source);
71
+ if (!(sourceIsArray === Array.isArray(target))) return cloneUnlessOtherwiseSpecified(source, options);
72
+ else if (sourceIsArray) return options.arrayMerge(target, source, options);
73
+ else return mergeObject(target, source, options);
74
+ }
75
+ deepmerge.all = function deepmergeAll(array, options) {
76
+ if (!Array.isArray(array)) throw new Error("first argument should be an array");
77
+ return array.reduce(function(prev, next) {
78
+ return deepmerge(prev, next, options);
79
+ }, {});
80
+ };
81
+ var deepmerge_1 = deepmerge;
82
+ module.exports = deepmerge_1;
83
+ }));
84
+
85
+ //#endregion
86
+ export default require_cjs();
87
+
88
+ export { require_cjs };
@@ -0,0 +1,212 @@
1
+ import { __commonJSMin } from "../../../_virtual/rolldown_runtime.js";
2
+
3
+ //#region ../../node_modules/focus-visible/dist/focus-visible.js
4
+ var require_focus_visible = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
+ (function(global, factory) {
6
+ typeof exports === "object" && typeof module !== "undefined" ? factory() : typeof define === "function" && define.amd ? define(factory) : factory();
7
+ })(exports, (function() {
8
+ "use strict";
9
+ /**
10
+ * Applies the :focus-visible polyfill at the given scope.
11
+ * A scope in this case is either the top-level Document or a Shadow Root.
12
+ *
13
+ * @param {(Document|ShadowRoot)} scope
14
+ * @see https://github.com/WICG/focus-visible
15
+ */
16
+ function applyFocusVisiblePolyfill(scope) {
17
+ var hadKeyboardEvent = true;
18
+ var hadFocusVisibleRecently = false;
19
+ var hadFocusVisibleRecentlyTimeout = null;
20
+ var inputTypesAllowlist = {
21
+ text: true,
22
+ search: true,
23
+ url: true,
24
+ tel: true,
25
+ email: true,
26
+ password: true,
27
+ number: true,
28
+ date: true,
29
+ month: true,
30
+ week: true,
31
+ time: true,
32
+ datetime: true,
33
+ "datetime-local": true
34
+ };
35
+ /**
36
+ * Helper function for legacy browsers and iframes which sometimes focus
37
+ * elements like document, body, and non-interactive SVG.
38
+ * @param {Element} el
39
+ */
40
+ function isValidFocusTarget(el) {
41
+ if (el && el !== document && el.nodeName !== "HTML" && el.nodeName !== "BODY" && "classList" in el && "contains" in el.classList) return true;
42
+ return false;
43
+ }
44
+ /**
45
+ * Computes whether the given element should automatically trigger the
46
+ * `focus-visible` class being added, i.e. whether it should always match
47
+ * `:focus-visible` when focused.
48
+ * @param {Element} el
49
+ * @return {boolean}
50
+ */
51
+ function focusTriggersKeyboardModality(el) {
52
+ var type = el.type;
53
+ var tagName = el.tagName;
54
+ if (tagName === "INPUT" && inputTypesAllowlist[type] && !el.readOnly) return true;
55
+ if (tagName === "TEXTAREA" && !el.readOnly) return true;
56
+ if (el.isContentEditable) return true;
57
+ return false;
58
+ }
59
+ /**
60
+ * Add the `focus-visible` class to the given element if it was not added by
61
+ * the author.
62
+ * @param {Element} el
63
+ */
64
+ function addFocusVisibleClass(el) {
65
+ if (el.classList.contains("focus-visible")) return;
66
+ el.classList.add("focus-visible");
67
+ el.setAttribute("data-focus-visible-added", "");
68
+ }
69
+ /**
70
+ * Remove the `focus-visible` class from the given element if it was not
71
+ * originally added by the author.
72
+ * @param {Element} el
73
+ */
74
+ function removeFocusVisibleClass(el) {
75
+ if (!el.hasAttribute("data-focus-visible-added")) return;
76
+ el.classList.remove("focus-visible");
77
+ el.removeAttribute("data-focus-visible-added");
78
+ }
79
+ /**
80
+ * If the most recent user interaction was via the keyboard;
81
+ * and the key press did not include a meta, alt/option, or control key;
82
+ * then the modality is keyboard. Otherwise, the modality is not keyboard.
83
+ * Apply `focus-visible` to any current active element and keep track
84
+ * of our keyboard modality state with `hadKeyboardEvent`.
85
+ * @param {KeyboardEvent} e
86
+ */
87
+ function onKeyDown(e) {
88
+ if (e.metaKey || e.altKey || e.ctrlKey) return;
89
+ if (isValidFocusTarget(scope.activeElement)) addFocusVisibleClass(scope.activeElement);
90
+ hadKeyboardEvent = true;
91
+ }
92
+ /**
93
+ * If at any point a user clicks with a pointing device, ensure that we change
94
+ * the modality away from keyboard.
95
+ * This avoids the situation where a user presses a key on an already focused
96
+ * element, and then clicks on a different element, focusing it with a
97
+ * pointing device, while we still think we're in keyboard modality.
98
+ * @param {Event} e
99
+ */
100
+ function onPointerDown(e) {
101
+ hadKeyboardEvent = false;
102
+ }
103
+ /**
104
+ * On `focus`, add the `focus-visible` class to the target if:
105
+ * - the target received focus as a result of keyboard navigation, or
106
+ * - the event target is an element that will likely require interaction
107
+ * via the keyboard (e.g. a text box)
108
+ * @param {Event} e
109
+ */
110
+ function onFocus(e) {
111
+ if (!isValidFocusTarget(e.target)) return;
112
+ if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) addFocusVisibleClass(e.target);
113
+ }
114
+ /**
115
+ * On `blur`, remove the `focus-visible` class from the target.
116
+ * @param {Event} e
117
+ */
118
+ function onBlur(e) {
119
+ if (!isValidFocusTarget(e.target)) return;
120
+ if (e.target.classList.contains("focus-visible") || e.target.hasAttribute("data-focus-visible-added")) {
121
+ hadFocusVisibleRecently = true;
122
+ window.clearTimeout(hadFocusVisibleRecentlyTimeout);
123
+ hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {
124
+ hadFocusVisibleRecently = false;
125
+ }, 100);
126
+ removeFocusVisibleClass(e.target);
127
+ }
128
+ }
129
+ /**
130
+ * If the user changes tabs, keep track of whether or not the previously
131
+ * focused element had .focus-visible.
132
+ * @param {Event} e
133
+ */
134
+ function onVisibilityChange(e) {
135
+ if (document.visibilityState === "hidden") {
136
+ if (hadFocusVisibleRecently) hadKeyboardEvent = true;
137
+ addInitialPointerMoveListeners();
138
+ }
139
+ }
140
+ /**
141
+ * Add a group of listeners to detect usage of any pointing devices.
142
+ * These listeners will be added when the polyfill first loads, and anytime
143
+ * the window is blurred, so that they are active when the window regains
144
+ * focus.
145
+ */
146
+ function addInitialPointerMoveListeners() {
147
+ document.addEventListener("mousemove", onInitialPointerMove);
148
+ document.addEventListener("mousedown", onInitialPointerMove);
149
+ document.addEventListener("mouseup", onInitialPointerMove);
150
+ document.addEventListener("pointermove", onInitialPointerMove);
151
+ document.addEventListener("pointerdown", onInitialPointerMove);
152
+ document.addEventListener("pointerup", onInitialPointerMove);
153
+ document.addEventListener("touchmove", onInitialPointerMove);
154
+ document.addEventListener("touchstart", onInitialPointerMove);
155
+ document.addEventListener("touchend", onInitialPointerMove);
156
+ }
157
+ function removeInitialPointerMoveListeners() {
158
+ document.removeEventListener("mousemove", onInitialPointerMove);
159
+ document.removeEventListener("mousedown", onInitialPointerMove);
160
+ document.removeEventListener("mouseup", onInitialPointerMove);
161
+ document.removeEventListener("pointermove", onInitialPointerMove);
162
+ document.removeEventListener("pointerdown", onInitialPointerMove);
163
+ document.removeEventListener("pointerup", onInitialPointerMove);
164
+ document.removeEventListener("touchmove", onInitialPointerMove);
165
+ document.removeEventListener("touchstart", onInitialPointerMove);
166
+ document.removeEventListener("touchend", onInitialPointerMove);
167
+ }
168
+ /**
169
+ * When the polfyill first loads, assume the user is in keyboard modality.
170
+ * If any event is received from a pointing device (e.g. mouse, pointer,
171
+ * touch), turn off keyboard modality.
172
+ * This accounts for situations where focus enters the page from the URL bar.
173
+ * @param {Event} e
174
+ */
175
+ function onInitialPointerMove(e) {
176
+ if (e.target.nodeName && e.target.nodeName.toLowerCase() === "html") return;
177
+ hadKeyboardEvent = false;
178
+ removeInitialPointerMoveListeners();
179
+ }
180
+ document.addEventListener("keydown", onKeyDown, true);
181
+ document.addEventListener("mousedown", onPointerDown, true);
182
+ document.addEventListener("pointerdown", onPointerDown, true);
183
+ document.addEventListener("touchstart", onPointerDown, true);
184
+ document.addEventListener("visibilitychange", onVisibilityChange, true);
185
+ addInitialPointerMoveListeners();
186
+ scope.addEventListener("focus", onFocus, true);
187
+ scope.addEventListener("blur", onBlur, true);
188
+ if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) scope.host.setAttribute("data-js-focus-visible", "");
189
+ else if (scope.nodeType === Node.DOCUMENT_NODE) {
190
+ document.documentElement.classList.add("js-focus-visible");
191
+ document.documentElement.setAttribute("data-js-focus-visible", "");
192
+ }
193
+ }
194
+ if (typeof window !== "undefined" && typeof document !== "undefined") {
195
+ window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;
196
+ var event;
197
+ try {
198
+ event = new CustomEvent("focus-visible-polyfill-ready");
199
+ } catch (error) {
200
+ event = document.createEvent("CustomEvent");
201
+ event.initCustomEvent("focus-visible-polyfill-ready", false, false, {});
202
+ }
203
+ window.dispatchEvent(event);
204
+ }
205
+ if (typeof document !== "undefined") applyFocusVisiblePolyfill(document);
206
+ }));
207
+ }));
208
+
209
+ //#endregion
210
+ export default require_focus_visible();
211
+
212
+ export { require_focus_visible };
@@ -0,0 +1,107 @@
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { ActionList } from "@primer/react";
4
+ import React from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/components/ActionList.tsx
8
+ const StyledActionList = styled(ActionList).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
9
+ displayName: "ActionList__StyledActionList",
10
+ componentId: "sc-hw2362-0"
11
+ })(["", ""], sx);
12
+ const ActionListImpl = /* @__PURE__ */ React.forwardRef(function ActionListImpl$1({ as, ...rest }, ref) {
13
+ return /* @__PURE__ */ jsx(StyledActionList, {
14
+ ref,
15
+ ...rest,
16
+ ...as ? { forwardedAs: as } : {}
17
+ });
18
+ });
19
+ const StyledActionListLinkItem = styled(ActionList.LinkItem).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
20
+ displayName: "ActionList__StyledActionListLinkItem",
21
+ componentId: "sc-hw2362-1"
22
+ })(["", ""], sx);
23
+ const ActionListLinkItem = /* @__PURE__ */ React.forwardRef(({ children, as, ...props }, ref) => /* @__PURE__ */ jsx(StyledActionListLinkItem, {
24
+ ref,
25
+ ...props,
26
+ ...as ? { forwardedAs: as } : {},
27
+ children
28
+ }));
29
+ ActionListLinkItem.displayName = "ActionList.LinkItem";
30
+ const StyledActionListTrailingAction = styled(ActionList.TrailingAction).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
31
+ displayName: "ActionList__StyledActionListTrailingAction",
32
+ componentId: "sc-hw2362-2"
33
+ })(["", ""], sx);
34
+ const ActionListTrailingAction = /* @__PURE__ */ React.forwardRef((props, ref) => {
35
+ const { as, ...rest } = props;
36
+ return /* @__PURE__ */ jsx(StyledActionListTrailingAction, {
37
+ ...rest,
38
+ ...as ? { forwardedAs: as } : {},
39
+ ref
40
+ });
41
+ });
42
+ const StyledActionListItem = styled(ActionList.Item).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
43
+ displayName: "ActionList__StyledActionListItem",
44
+ componentId: "sc-hw2362-3"
45
+ })(["", ""], sx);
46
+ const ActionListItem = /* @__PURE__ */ React.forwardRef(({ children, as, ...props }, ref) => /* @__PURE__ */ jsx(StyledActionListItem, {
47
+ ref,
48
+ ...props,
49
+ ...as ? { forwardedAs: as } : {},
50
+ children
51
+ }));
52
+ const StyledActionListGroup = styled(ActionList.Group).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
53
+ displayName: "ActionList__StyledActionListGroup",
54
+ componentId: "sc-hw2362-4"
55
+ })(["", ""], sx);
56
+ const ActionListGroup = ({ children, as, ...props }) => /* @__PURE__ */ jsx(StyledActionListGroup, {
57
+ ...props,
58
+ ...as ? { forwardedAs: as } : {},
59
+ children
60
+ });
61
+ ActionListGroup.displayName = "ActionList.Group";
62
+ const ActionListDivider = styled(ActionList.Divider).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
63
+ displayName: "ActionList__ActionListDivider",
64
+ componentId: "sc-hw2362-5"
65
+ })(["", ""], sx);
66
+ const StyledActionListLeadingVisual = styled(ActionList.LeadingVisual).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
67
+ displayName: "ActionList__StyledActionListLeadingVisual",
68
+ componentId: "sc-hw2362-6"
69
+ })(["", ""], sx);
70
+ const ActionListLeadingVisual = ({ children, as, ...props }) => /* @__PURE__ */ jsx(StyledActionListLeadingVisual, {
71
+ ...props,
72
+ ...as ? { forwardedAs: as } : {},
73
+ children
74
+ });
75
+ ActionListLeadingVisual.displayName = "ActionList.LeadingVisual";
76
+ const StyledActionListTrailingVisual = styled(ActionList.TrailingVisual).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
77
+ displayName: "ActionList__StyledActionListTrailingVisual",
78
+ componentId: "sc-hw2362-7"
79
+ })(["", ""], sx);
80
+ const ActionListTrailingVisual = ({ children, as, ...props }) => /* @__PURE__ */ jsx(StyledActionListTrailingVisual, {
81
+ ...props,
82
+ ...as ? { forwardedAs: as } : {},
83
+ children
84
+ });
85
+ ActionListTrailingVisual.displayName = "ActionList.TrailingVisual";
86
+ const ActionList$1 = Object.assign(ActionListImpl, {
87
+ Item: ActionListItem,
88
+ LinkItem: ActionListLinkItem,
89
+ Group: ActionListGroup,
90
+ GroupHeading: ActionList.GroupHeading,
91
+ Divider: ActionListDivider,
92
+ Description: ActionList.Description,
93
+ LeadingVisual: ActionListLeadingVisual,
94
+ TrailingVisual: ActionListTrailingVisual,
95
+ Heading: ActionList.Heading,
96
+ TrailingAction: ActionListTrailingAction
97
+ });
98
+ ActionListItem.__SLOT__ = ActionList.Item.__SLOT__;
99
+ ActionListLinkItem.__SLOT__ = ActionList.LinkItem.__SLOT__;
100
+ ActionListGroup.__SLOT__ = ActionList.Group.__SLOT__;
101
+ ActionListDivider.__SLOT__ = ActionList.Divider.__SLOT__;
102
+ ActionListLeadingVisual.__SLOT__ = ActionList.LeadingVisual.__SLOT__;
103
+ ActionListTrailingVisual.__SLOT__ = ActionList.TrailingVisual.__SLOT__;
104
+ ActionListTrailingAction.__SLOT__ = ActionList.TrailingAction.__SLOT__;
105
+
106
+ //#endregion
107
+ export { ActionList$1 as ActionList };
@@ -0,0 +1,19 @@
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { ActionMenu } from "@primer/react";
4
+
5
+ //#region src/components/ActionMenu.tsx
6
+ const ActionMenuOverlay = styled(ActionMenu.Overlay).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
7
+ displayName: "ActionMenu__ActionMenuOverlay",
8
+ componentId: "sc-w5s60e-0"
9
+ })(["", ""], sx);
10
+ const ActionMenu$1 = Object.assign(ActionMenu, {
11
+ Button: ActionMenu.Button,
12
+ Anchor: ActionMenu.Anchor,
13
+ Overlay: ActionMenuOverlay,
14
+ Divider: ActionMenu.Divider
15
+ });
16
+ ActionMenuOverlay.__SLOT__ = ActionMenu.Overlay.__SLOT__;
17
+
18
+ //#endregion
19
+ export { ActionMenu$1 as ActionMenu };
@@ -0,0 +1,23 @@
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { Autocomplete } from "@primer/react";
4
+
5
+ //#region src/components/Autocomplete.tsx
6
+ const AutocompleteOverlay = styled(Autocomplete.Overlay).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
7
+ displayName: "Autocomplete__AutocompleteOverlay",
8
+ componentId: "sc-j8ax2e-0"
9
+ })(["", ""], sx);
10
+ const AutocompleteInput = styled(Autocomplete.Input).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
11
+ displayName: "Autocomplete__AutocompleteInput",
12
+ componentId: "sc-j8ax2e-1"
13
+ })(["", ""], sx);
14
+ const Autocomplete$1 = Object.assign(Autocomplete, {
15
+ Context: Autocomplete.Context,
16
+ Input: AutocompleteInput,
17
+ Menu: Autocomplete.Menu,
18
+ Overlay: AutocompleteOverlay
19
+ });
20
+ AutocompleteOverlay.__SLOT__ = Autocomplete.Overlay.__SLOT__;
21
+
22
+ //#endregion
23
+ export { Autocomplete$1 as Autocomplete };
@@ -0,0 +1,16 @@
1
+ import { Box } from "./Box.js";
2
+ import { Avatar } from "@primer/react";
3
+ import { forwardRef } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region src/components/Avatar.tsx
7
+ const Avatar$1 = /* @__PURE__ */ forwardRef(function Avatar$2(props, ref) {
8
+ return /* @__PURE__ */ jsx(Box, {
9
+ as: Avatar,
10
+ ref,
11
+ ...props
12
+ });
13
+ });
14
+
15
+ //#endregion
16
+ export { Avatar$1 as Avatar };
@@ -1,51 +1,33 @@
1
- import { clsx } from 'clsx';
2
- import { useTheme } from './ThemeProvider.js';
3
- import 'focus-visible';
4
- import { createGlobalStyle } from 'styled-components';
5
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { useTheme } from "./ThemeProvider.js";
2
+ import { clsx } from "../../../../node_modules/clsx/dist/clsx.js";
3
+ import { require_focus_visible } from "../../../../node_modules/focus-visible/dist/focus-visible.js";
4
+ import { createGlobalStyle } from "styled-components";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
 
7
+ //#region src/components/BaseStyles.tsx
8
+ var import_focus_visible = require_focus_visible();
7
9
  const GlobalStyle = createGlobalStyle(["*{box-sizing:border-box;}body{margin:0;}table{border-collapse:collapse;}[data-color-mode='light'] input{color-scheme:light;}[data-color-mode='dark'] input{color-scheme:dark;}@media (prefers-color-scheme:light){[data-color-mode='auto'][data-light-theme*='light']{color-scheme:light;}}@media (prefers-color-scheme:dark){[data-color-mode='auto'][data-dark-theme*='dark']{color-scheme:dark;}}[role='button']:focus:not(:focus-visible):not(:global(.focus-visible)),[role='tabpanel'][tabindex='0']:focus:not(:focus-visible):not(:global(.focus-visible)),button:focus:not(:focus-visible):not(:global(.focus-visible)),summary:focus:not(:focus-visible):not(:global(.focus-visible)),a:focus:not(:focus-visible):not(:global(.focus-visible)){outline:none;box-shadow:none;}[tabindex='0']:focus:not(:focus-visible):not(:global(.focus-visible)),details-dialog:focus:not(:focus-visible):not(:global(.focus-visible)){outline:none;}.BaseStyles{font-family:var(--BaseStyles-fontFamily,var(--fontStack-system));line-height:var(--BaseStyles-lineHeight,1.5);color:var(--BaseStyles-fgColor,var(--fgColor-default));&:has([data-color-mode='light']){input &{color-scheme:light;}}&:has([data-color-mode='dark']){input &{color-scheme:dark;}}:where(a:not([class*='prc-']):not([class*='PRC-']):not([class*='Primer_Brand__'])){color:var(--fgColor-accent,var(--color-accent-fg));text-decoration:none;&:hover{text-decoration:underline;}}}"]);
8
- function BaseStyles({
9
- children,
10
- color,
11
- fontFamily,
12
- lineHeight,
13
- className,
14
- as: Component = 'div',
15
- style,
16
- ...rest
17
- }) {
18
- const {
19
- colorMode,
20
- colorScheme,
21
- dayScheme,
22
- nightScheme
23
- } = useTheme();
24
- const baseStyles = {
25
- ['--BaseStyles-fgColor']: color,
26
- ['--BaseStyles-fontFamily']: fontFamily,
27
- ['--BaseStyles-lineHeight']: lineHeight
28
- };
29
- return /*#__PURE__*/jsxs(Component, {
30
- className: clsx('BaseStyles', className),
31
- "data-portal-root": true
32
- /**
33
- * We need to map valid primer/react color modes onto valid color modes for primer/primitives
34
- * valid color modes for primer/primitives: auto | light | dark
35
- * valid color modes for primer/primer: auto | day | night | light | dark
36
- */,
37
- "data-color-mode": colorMode === 'auto' ? 'auto' : colorScheme?.includes('dark') ? 'dark' : 'light',
38
- "data-light-theme": dayScheme,
39
- "data-dark-theme": nightScheme,
40
- style: {
41
- ...baseStyles,
42
- ...style
43
- },
44
- ...rest,
45
- children: [/*#__PURE__*/jsx(GlobalStyle, {
46
- colorScheme: colorScheme?.includes('dark') ? 'dark' : 'light'
47
- }), children]
48
- });
10
+ function BaseStyles({ children, color, fontFamily, lineHeight, className, as: Component = "div", style, ...rest }) {
11
+ const { colorMode, colorScheme, dayScheme, nightScheme } = useTheme();
12
+ const baseStyles = {
13
+ ["--BaseStyles-fgColor"]: color,
14
+ ["--BaseStyles-fontFamily"]: fontFamily,
15
+ ["--BaseStyles-lineHeight"]: lineHeight
16
+ };
17
+ return /* @__PURE__ */ jsxs(Component, {
18
+ className: clsx("BaseStyles", className),
19
+ "data-portal-root": true,
20
+ "data-color-mode": colorMode === "auto" ? "auto" : colorScheme?.includes("dark") ? "dark" : "light",
21
+ "data-light-theme": dayScheme,
22
+ "data-dark-theme": nightScheme,
23
+ style: {
24
+ ...baseStyles,
25
+ ...style
26
+ },
27
+ ...rest,
28
+ children: [/* @__PURE__ */ jsx(GlobalStyle, { colorScheme: colorScheme?.includes("dark") ? "dark" : "light" }), children]
29
+ });
49
30
  }
50
31
 
51
- export { BaseStyles };
32
+ //#endregion
33
+ export { BaseStyles };
@@ -0,0 +1,23 @@
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { background, border, color, flexbox, grid, layout, position, shadow, space, typography } from "styled-system";
4
+
5
+ //#region src/components/Box.tsx
6
+ /**
7
+ * @deprecated The Box component is deprecated. Replace with a `div` or
8
+ * appropriate HTML element instead, with CSS modules for styling.
9
+ * @see https://github.com/primer/react/blob/main/contributor-docs/migration-from-box.md
10
+ */
11
+ const Box = styled.div.withConfig({
12
+ displayName: "Box",
13
+ componentId: "sc-62in7e-0"
14
+ })(space, color, typography, layout, flexbox, grid, background, border, position, shadow, sx);
15
+ /**
16
+ * @deprecated The Box component is deprecated. Replace with a `div` or
17
+ * appropriate HTML element instead, with CSS modules for styling.
18
+ * @see https://github.com/primer/react/blob/main/contributor-docs/migration-from-box.md
19
+ */
20
+ var Box_default = Box;
21
+
22
+ //#endregion
23
+ export { Box, Box_default as default };
@@ -0,0 +1,28 @@
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { Breadcrumbs } from "@primer/react";
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region src/components/Breadcrumbs.tsx
7
+ const BreadcrumbsImpl = styled(Breadcrumbs).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
8
+ displayName: "Breadcrumbs__BreadcrumbsImpl",
9
+ componentId: "sc-1qj8pw-0"
10
+ })(["", ""], sx);
11
+ const StyledBreadcrumbsItem = styled(Breadcrumbs.Item).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
12
+ displayName: "Breadcrumbs__StyledBreadcrumbsItem",
13
+ componentId: "sc-1qj8pw-1"
14
+ })(["", ""], sx);
15
+ function BreadcrumbsItem({ as, ...props }) {
16
+ return /* @__PURE__ */ jsx(StyledBreadcrumbsItem, {
17
+ ...props,
18
+ ...as ? { forwardedAs: as } : {}
19
+ });
20
+ }
21
+ const Breadcrumbs$1 = Object.assign(BreadcrumbsImpl, { Item: BreadcrumbsItem });
22
+ /**
23
+ * @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`)
24
+ */
25
+ const Breadcrumb = Breadcrumbs$1;
26
+
27
+ //#endregion
28
+ export { Breadcrumb, Breadcrumbs$1 as Breadcrumbs };