@assembly-js/design-system 3.1.8 → 3.1.9

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 (29) hide show
  1. package/dist/esm/common/utils.js +24 -1
  2. package/dist/esm/components/Checkbox/Checkbox.js +1 -1
  3. package/dist/esm/components/IconPicker/IconPicker.js +12 -7
  4. package/dist/esm/components/IconPicker/index.js +1 -0
  5. package/dist/esm/components/TextLink/TextLink.js +1 -1
  6. package/dist/esm/components/Typography/Base.js +1 -1
  7. package/dist/esm/types/components/Avatar/Avatar.d.ts +2 -2
  8. package/dist/esm/types/components/IconPicker/IconPicker.d.ts +3 -0
  9. package/dist/esm/types/components/IconPicker/IconPicker.stories.d.ts +1 -0
  10. package/dist/esm/types/components/IconPicker/index.d.ts +2 -0
  11. package/dist/esm/types/tsconfig.tsbuildinfo +1 -1
  12. package/dist/styles/main.css +1 -1
  13. package/dist/types/components/Avatar/Avatar.d.ts +2 -2
  14. package/dist/types/components/IconPicker/IconPicker.d.ts +3 -0
  15. package/dist/types/components/IconPicker/IconPicker.stories.d.ts +1 -0
  16. package/dist/types/components/IconPicker/index.d.ts +2 -0
  17. package/dist/types/tsconfig.tsbuildinfo +1 -1
  18. package/dist/umd/common/utils.js +24 -1
  19. package/dist/umd/components/Checkbox/Checkbox.js +1 -1
  20. package/dist/umd/components/IconPicker/IconPicker.js +12 -7
  21. package/dist/umd/components/IconPicker/index.js +10 -4
  22. package/dist/umd/components/TextLink/TextLink.js +1 -1
  23. package/dist/umd/components/Typography/Base.js +1 -1
  24. package/dist/umd/types/components/Avatar/Avatar.d.ts +2 -2
  25. package/dist/umd/types/components/IconPicker/IconPicker.d.ts +3 -0
  26. package/dist/umd/types/components/IconPicker/IconPicker.stories.d.ts +1 -0
  27. package/dist/umd/types/components/IconPicker/index.d.ts +2 -0
  28. package/dist/umd/types/tsconfig.tsbuildinfo +1 -1
  29. package/package.json +2 -2
@@ -1,8 +1,31 @@
1
1
  // This file is generated by a script. Do not edit this file directly.
2
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
2
8
  import { clsx } from 'clsx';
3
9
  import { extendTailwindMerge } from 'tailwind-merge';
10
+ var COP_PREFIX = 'cop-';
11
+ function stripCopPrefix(_ref) {
12
+ var className = _ref.className,
13
+ parseClassName = _ref.parseClassName;
14
+ var parsed = parseClassName(className);
15
+ if (parsed.baseClassName.startsWith(COP_PREFIX)) {
16
+ return _objectSpread(_objectSpread({}, parsed), {}, {
17
+ baseClassName: parsed.baseClassName.slice(COP_PREFIX.length)
18
+ });
19
+ }
20
+ return parsed;
21
+ }
22
+
23
+ // `prefix: 'cop-'` was replaced with a custom parser because the built-in
24
+ // prefix option failed to merge mixed prefixed/non-prefixed classes correctly.
25
+ // `experimentalParseClassName` is experimental — revisit this if upgrading
26
+ // tailwind-merge to a new major version.
4
27
  var twMerge = extendTailwindMerge({
5
- prefix: 'cop-'
28
+ experimentalParseClassName: stripCopPrefix
6
29
  });
7
30
  export function cn() {
8
31
  for (var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -20,7 +20,7 @@ export var CheckboxSize = /*#__PURE__*/function (CheckboxSize) {
20
20
  return CheckboxSize;
21
21
  }({});
22
22
  var checkboxContainerStyles = cva({
23
- base: 'cop-box-border cop-flex cop-cursor-pointer cop-rounded-[3px] cop-border cop-border-solid cop-p-0 cop-outline-none peer-focus-visible:cop-outline-2 peer-focus-visible:cop-outline-[#0071E3] flex cop-justify-center cop-items-center',
23
+ base: 'cop-box-border cop-flex cop-cursor-pointer cop-rounded-[3px] cop-border cop-border-solid cop-p-0 cop-outline-none peer-focus-visible:cop-outline-2 peer-focus-visible:cop-outline-[#0071E3] cop-justify-center cop-items-center',
24
24
  variants: {
25
25
  size: _defineProperty(_defineProperty({}, CheckboxSize.DEFAULT, 'cop-h-4 cop-w-4'), CheckboxSize.LARGE, 'cop-h-[18px] cop-w-[18px]'),
26
26
  checked: {
@@ -24,7 +24,8 @@ var IconPicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
24
24
  placeholder = _ref$placeholder === void 0 ? 'Select an icon' : _ref$placeholder,
25
25
  className = _ref.className,
26
26
  _ref$disabled = _ref.disabled,
27
- disabled = _ref$disabled === void 0 ? false : _ref$disabled;
27
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
28
+ inlineAction = _ref.inlineAction;
28
29
  var isControlled = value !== undefined;
29
30
  var _React$useState = React.useState(defaultValue),
30
31
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -175,12 +176,15 @@ var IconPicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
175
176
  return document.removeEventListener('keydown', handleKeyDown);
176
177
  };
177
178
  }, [open]);
179
+ var closeAndReset = React.useCallback(function () {
180
+ setOpen(false);
181
+ setSearch('');
182
+ }, []);
178
183
  var handleSelect = React.useCallback(function (icon) {
179
184
  if (!isControlled) setInternalValue(icon.name);
180
185
  onChange === null || onChange === void 0 || onChange(icon.name);
181
- setOpen(false);
182
- setSearch('');
183
- }, [isControlled, onChange]);
186
+ closeAndReset();
187
+ }, [isControlled, onChange, closeAndReset]);
184
188
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
185
189
  ref: triggerRef,
186
190
  className: "cop-inline-flex"
@@ -217,8 +221,9 @@ var IconPicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
217
221
  },
218
222
  className: "cop-fixed cop-z-1500 cop-w-[330px] cop-overflow-clip cop-rounded cop-border cop-border-solid cop-border-[#eff1f4] cop-bg-white cop-shadow-[0px_6px_20px_0px_rgba(0,0,0,0.07)]"
219
223
  }, /*#__PURE__*/React.createElement("div", {
220
- className: "cop-px-3 cop-pt-3"
224
+ className: "cop-flex cop-items-center cop-gap-2 cop-px-3 cop-pt-3"
221
225
  }, /*#__PURE__*/React.createElement(Input, {
226
+ containerClassName: "cop-flex-1 cop-min-w-0",
222
227
  ref: searchInputRef,
223
228
  placeholder: "Search icons",
224
229
  value: search,
@@ -236,8 +241,8 @@ var IconPicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
236
241
  (_gridRef$current2 = gridRef.current) === null || _gridRef$current2 === void 0 || _gridRef$current2.focusFirst();
237
242
  }
238
243
  },
239
- className: "focus-visible:cop-border-[#1a1a1a] focus-visible:cop-ring-0 focus-visible:cop-ring-offset-0"
240
- })), /*#__PURE__*/React.createElement("div", {
244
+ className: "cop-h-8 !cop-border-input-gray focus-visible:!cop-border-[#1a1a1a] focus-visible:cop-ring-0 focus-visible:cop-ring-offset-0"
245
+ }), inlineAction === null || inlineAction === void 0 ? void 0 : inlineAction(closeAndReset)), /*#__PURE__*/React.createElement("div", {
241
246
  className: "cop-py-3 cop-pl-3 cop-pr-0"
242
247
  }, /*#__PURE__*/React.createElement(IconGrid, {
243
248
  ref: gridRef,
@@ -1,3 +1,4 @@
1
1
  // This file is generated by a script. Do not edit this file directly.
2
2
  import React from "react";
3
3
  export { IconPicker } from "./IconPicker";
4
+ export { pickerIcons } from "./pickerIcons";
@@ -6,7 +6,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
6
6
  import React from 'react';
7
7
  import { cva } from 'cva';
8
8
  var textLinkClasses = cva({
9
- base: 'cop-flex cop-items-center cop-gap-1.5 outline-none cop-outline-solid cop-outline-link cop-outline-offset-[3px] cop-w-fit cop-underline-offset-[3px] cursor-pointer',
9
+ base: 'cop-flex cop-items-center cop-gap-1.5 cop-outline-none cop-outline-solid cop-outline-link cop-outline-offset-[3px] cop-w-fit cop-underline-offset-[3px] cop-cursor-pointer',
10
10
  variants: {
11
11
  variant: {
12
12
  "default": 'cop-text-link cop-no-underline hover:cop-text-link-hover active:cop-text-link-active',
@@ -46,7 +46,7 @@ var WEIGHT_CLASSNAMES = {
46
46
  bold: 'cop-font-bold',
47
47
  semibold: 'cop-font-semibold',
48
48
  medium: 'cop-font-medium',
49
- regular: 'cop-font-regular',
49
+ regular: '',
50
50
  light: 'cop-font-light'
51
51
  };
52
52
  export var Base = function Base(_ref) {
@@ -20,8 +20,8 @@ declare const Avatar: React.ForwardRefExoticComponent<({
20
20
  content?: string | undefined;
21
21
  translate?: "yes" | "no" | undefined;
22
22
  prefix?: string | undefined;
23
- children?: React.ReactNode;
24
23
  className?: string | undefined;
24
+ children?: React.ReactNode;
25
25
  slot?: string | undefined;
26
26
  style?: React.CSSProperties | undefined;
27
27
  title?: string | undefined;
@@ -299,8 +299,8 @@ declare const Avatar: React.ForwardRefExoticComponent<({
299
299
  content?: string | undefined;
300
300
  translate?: "yes" | "no" | undefined;
301
301
  prefix?: string | undefined;
302
- children?: React.ReactNode;
303
302
  className?: string | undefined;
303
+ children?: React.ReactNode;
304
304
  slot?: string | undefined;
305
305
  style?: React.CSSProperties | undefined;
306
306
  title?: string | undefined;
@@ -10,6 +10,9 @@ export interface IconPickerProps {
10
10
  placeholder?: string;
11
11
  className?: string;
12
12
  disabled?: boolean;
13
+ /** Optional render prop for an inline action next to the search input.
14
+ * Receives a `closePopover` callback to dismiss the picker. */
15
+ inlineAction?: (closePopover: () => void) => React.ReactNode;
13
16
  }
14
17
  declare const IconPicker: React.ForwardRefExoticComponent<IconPickerProps & React.RefAttributes<HTMLDivElement>>;
15
18
  export { IconPicker };
@@ -6,3 +6,4 @@ export default meta;
6
6
  type Story = StoryObj<typeof meta>;
7
7
  export declare const Default: Story;
8
8
  export declare const WithValue: Story;
9
+ export declare const WithInlineAction: Story;
@@ -1,3 +1,5 @@
1
1
  export { IconPicker } from './IconPicker';
2
2
  export type { IconPickerProps } from './IconPicker';
3
3
  export type { FAIcon } from './icons.generated';
4
+ export { pickerIcons } from './pickerIcons';
5
+ export type { PickerIcon } from './pickerIcons';