@dreamcommerce/aurora 3.0.0-40 → 3.0.0-43
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/build/cjs/packages/aurora/src/components/drawer/components/drawer_close.js +10 -0
- package/build/cjs/packages/aurora/src/components/drawer/components/drawer_close.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/drawer/components/drawer_content.js +29 -0
- package/build/cjs/packages/aurora/src/components/drawer/components/drawer_content.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/drawer/components/drawer_portal.js +10 -0
- package/build/cjs/packages/aurora/src/components/drawer/components/drawer_portal.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/drawer/components/drawer_title.js +36 -0
- package/build/cjs/packages/aurora/src/components/drawer/components/drawer_title.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/drawer/components/drawer_trigger.js +10 -0
- package/build/cjs/packages/aurora/src/components/drawer/components/drawer_trigger.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/drawer/context/drawer_context.js +17 -0
- package/build/cjs/packages/aurora/src/components/drawer/context/drawer_context.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/drawer/drawer.js +29 -0
- package/build/cjs/packages/aurora/src/components/drawer/drawer.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/drawer/drawer_constants.js +13 -0
- package/build/cjs/packages/aurora/src/components/drawer/drawer_constants.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/drawer/drawer_variants.js +22 -0
- package/build/cjs/packages/aurora/src/components/drawer/drawer_variants.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/label/label.js +5 -5
- package/build/cjs/packages/aurora/src/hooks/search/use_search.js +28 -0
- package/build/cjs/packages/aurora/src/hooks/search/use_search.js.map +1 -0
- package/build/cjs/packages/aurora/src/index.js +14 -0
- package/build/cjs/packages/aurora/src/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/utilities/fuzzy_search.js +65 -0
- package/build/cjs/packages/aurora/src/utilities/fuzzy_search.js.map +1 -0
- package/build/esm/packages/aurora/src/components/control/control.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/control/control.js +5 -0
- package/build/esm/packages/aurora/src/components/control/control.js.map +1 -0
- package/build/esm/packages/aurora/src/components/control/control_types.d.ts +5 -0
- package/build/esm/packages/aurora/src/components/control/control_types.js +2 -0
- package/build/esm/packages/aurora/src/components/control/control_types.js.map +1 -0
- package/build/esm/packages/aurora/src/components/controls/switch_control/switch_control.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/controls/switch_control/switch_control.js +14 -0
- package/build/esm/packages/aurora/src/components/controls/switch_control/switch_control.js.map +1 -0
- package/build/esm/packages/aurora/src/components/controls/switch_control/switch_control_types.d.ts +8 -0
- package/build/esm/packages/aurora/src/components/controls/switch_control/switch_control_types.js +3 -0
- package/build/esm/packages/aurora/src/components/controls/switch_control/switch_control_types.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_close.d.ts +2 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_close.js +6 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_close.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_content.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_content.js +25 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_content.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_header.d.ts +5 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_header.js +5 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_header.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_overlay.d.ts +2 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_overlay.js +6 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_overlay.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_portal.d.ts +1 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_portal.js +6 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_portal.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_title.d.ts +2 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_title.js +32 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_title.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_trigger.d.ts +2 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_trigger.js +6 -0
- package/build/esm/packages/aurora/src/components/drawer/components/drawer_trigger.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/context/drawer_context.d.ts +5 -0
- package/build/esm/packages/aurora/src/components/drawer/context/drawer_context.js +9 -0
- package/build/esm/packages/aurora/src/components/drawer/context/drawer_context.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer.d.ts +6 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer.js +25 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer_constants.d.ts +6 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer_constants.js +9 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer_constants.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer_types.d.ts +6 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer_types.js +3 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer_types.js.map +1 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer_variants.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer_variants.js +18 -0
- package/build/esm/packages/aurora/src/components/drawer/drawer_variants.js.map +1 -0
- package/build/esm/packages/aurora/src/components/label/label.js +5 -5
- package/build/esm/packages/aurora/src/components/label/label_types.d.ts +2 -2
- package/build/esm/packages/aurora/src/components/switch/components/switch_thumb.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/switch/components/switch_thumb.js +3 -0
- package/build/esm/packages/aurora/src/components/switch/components/switch_thumb.js.map +1 -0
- package/build/esm/packages/aurora/src/components/switch/switch.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/switch/switch.js +11 -0
- package/build/esm/packages/aurora/src/components/switch/switch.js.map +1 -0
- package/build/esm/packages/aurora/src/components/switch/switch_types.d.ts +5 -0
- package/build/esm/packages/aurora/src/components/switch/switch_types.js +2 -0
- package/build/esm/packages/aurora/src/components/switch/switch_types.js.map +1 -0
- package/build/esm/packages/aurora/src/components/tag/tag.js +1 -1
- package/build/esm/packages/aurora/src/components/tag/tag.js.map +1 -1
- package/build/esm/packages/aurora/src/components/tag/tag_variants.js +1 -1
- package/build/esm/packages/aurora/src/components/tag/tag_variants.js.map +1 -1
- package/build/esm/packages/aurora/src/hooks/search/use_search.d.ts +2 -0
- package/build/esm/packages/aurora/src/hooks/search/use_search.js +24 -0
- package/build/esm/packages/aurora/src/hooks/search/use_search.js.map +1 -0
- package/build/esm/packages/aurora/src/hooks/search/use_search_types.d.ts +10 -0
- package/build/esm/packages/aurora/src/hooks/search/use_search_types.js +2 -0
- package/build/esm/packages/aurora/src/hooks/search/use_search_types.js.map +1 -0
- package/build/esm/packages/aurora/src/index.d.ts +7 -0
- package/build/esm/packages/aurora/src/index.js +7 -0
- package/build/esm/packages/aurora/src/index.js.map +1 -1
- package/build/esm/packages/aurora/src/utilities/fuzzy_search.d.ts +17 -0
- package/build/esm/packages/aurora/src/utilities/fuzzy_search.js +57 -0
- package/build/esm/packages/aurora/src/utilities/fuzzy_search.js.map +1 -0
- package/build/index.css +1 -1
- package/package.json +7 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
export declare const DrawerContext: React.Context<VariantProps<(props?: ({
|
|
4
|
+
direction?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DRAWER_DIRECTIONS } from '../drawer_constants.js';
|
|
3
|
+
|
|
4
|
+
var DrawerContext = /*#__PURE__*/React.createContext({
|
|
5
|
+
direction: DRAWER_DIRECTIONS.left
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export { DrawerContext };
|
|
9
|
+
//# sourceMappingURL=drawer_context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { Drawer as Drawer$1 } from 'vaul';
|
|
4
|
+
import { DrawerContext } from './context/drawer_context.js';
|
|
5
|
+
|
|
6
|
+
var _excluded = ["shouldScaleBackground", "direction"];
|
|
7
|
+
var Drawer = function Drawer(_ref) {
|
|
8
|
+
var _ref$shouldScaleBackg = _ref.shouldScaleBackground,
|
|
9
|
+
shouldScaleBackground = _ref$shouldScaleBackg === void 0 ? true : _ref$shouldScaleBackg,
|
|
10
|
+
_ref$direction = _ref.direction,
|
|
11
|
+
direction = _ref$direction === void 0 ? 'left' : _ref$direction,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
return /*#__PURE__*/createElement(DrawerContext.Provider, {
|
|
14
|
+
value: {
|
|
15
|
+
direction: direction
|
|
16
|
+
}
|
|
17
|
+
}, /*#__PURE__*/createElement(Drawer$1.Root, _objectSpread2({
|
|
18
|
+
shouldScaleBackground: shouldScaleBackground,
|
|
19
|
+
direction: direction
|
|
20
|
+
}, props)));
|
|
21
|
+
};
|
|
22
|
+
Drawer.displayName = 'Drawer';
|
|
23
|
+
|
|
24
|
+
export { Drawer };
|
|
25
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
3
|
+
export declare type TDrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
|
|
4
|
+
export declare type TDrawerContentProps = React.ComponentProps<typeof DrawerPrimitive.Content> & {
|
|
5
|
+
offset?: number;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer_types.js","sourceRoot":"","sources":["../../../../../../../src/components/drawer/drawer_types.ts"],"names":[],"mappings":"AAAA,OAAuB,OAAO,CAAC;AAC/B,OAA0C,MAAM,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cva } from '../../../../../external/class-variance-authority/dist/index.mjs.js';
|
|
2
|
+
|
|
3
|
+
var drawerVariants = cva('', {
|
|
4
|
+
variants: {
|
|
5
|
+
direction: {
|
|
6
|
+
left: 'aurora-left-0 aurora-top-0',
|
|
7
|
+
right: 'aurora-right-0 aurora-top-0',
|
|
8
|
+
top: 'aurora-top-0 aurora-left-0',
|
|
9
|
+
bottom: 'aurora-bottom-0 aurora-left-0'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
direction: 'left'
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export { drawerVariants };
|
|
18
|
+
//# sourceMappingURL=drawer_variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,oBAAoB,oEAAwE;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -10,19 +10,19 @@ import { Root } from '@radix-ui/react-label';
|
|
|
10
10
|
import { LabelContent } from './components/label_content.js';
|
|
11
11
|
import { labelVariants } from './label_variants.js';
|
|
12
12
|
|
|
13
|
-
var _excluded = ["className", "tooltip", "
|
|
13
|
+
var _excluded = ["className", "tooltip", "required", "disabled", "children"];
|
|
14
14
|
var Label = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
15
15
|
var className = _ref.className,
|
|
16
16
|
tooltip = _ref.tooltip,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
required = _ref.required,
|
|
18
|
+
disabled = _ref.disabled,
|
|
19
19
|
children = _ref.children,
|
|
20
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
21
|
var content = /*#__PURE__*/createElement(Box, {
|
|
22
22
|
align: "center",
|
|
23
23
|
spacing: "0.5",
|
|
24
|
-
className: cn(labelVariants(), "".concat(
|
|
25
|
-
},
|
|
24
|
+
className: cn(labelVariants(), "".concat(disabled ? 'aurora-cursor-not-allowed aurora-text-subtle-light' : '', " ").concat(className))
|
|
25
|
+
}, required && /*#__PURE__*/createElement("span", {
|
|
26
26
|
className: "aurora-text-interactive"
|
|
27
27
|
}, "*"), children);
|
|
28
28
|
if (tooltip) {
|
|
@@ -4,6 +4,6 @@ import { labelVariants } from './label_variants';
|
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
export interface LabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>, VariantProps<typeof labelVariants> {
|
|
6
6
|
tooltip?: string | ReactNode;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
required?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch_thumb.js","sourceRoot":"","sources":["../../../../../../../../src/components/switch/components/switch_thumb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import './switch_types';
|
|
5
|
+
export const Switch = React.forwardRef(({ id, name, value, className, disabled, checked, defaultChecked, errors = [], onCheckedChange, ...props }, ref) => {
|
|
6
|
+
return (React.createElement(SwitchPrimitive.Root, { id: id, name: name, value: value, ref: ref, className: classnames('aurora-inline-flex aurora-items-center aurora-relative aurora-w-11 aurora-h-6 aurora-rounded-full aurora-bg-active hover:aurora-ring-2 hover:aurora-ring-subtle focus:aurora-ring-2 focus:aurora-ring-primary focus:aurora-outline-none focus:aurora-ring-offset aurora-cursor-pointer aurora-transition-all data-[state=checked]:aurora-bg-primary', disabled &&
|
|
7
|
+
'aurora-cursor-not-allowed aurora-pointer-events-none aurora-bg-neutral-300 data-[state=checked]:!aurora-bg-active', errors && errors.length > 0 && 'aurora-ring-danger aurora-ring-2', className), disabled: disabled, defaultChecked: defaultChecked, checked: checked, onCheckedChange: onCheckedChange, ...props },
|
|
8
|
+
React.createElement(SwitchPrimitive.SwitchThumb, { className: classnames('aurora-block aurora-w-5 aurora-h-5 aurora-rounded-full aurora-transition-transform', disabled ? 'aurora-bg-subtle' : 'aurora-bg', 'data-[state=checked]:aurora-translate-x-[22px] aurora-translate-x-[2px]') })));
|
|
9
|
+
});
|
|
10
|
+
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
11
|
+
//# sourceMappingURL=switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../../../../../src/components/switch/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAA6B,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAClC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC/G,OAAO,CACH,oBAAC,eAAe,CAAC,IAAI,IACjB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CACjB,qVAAqV,EACrV,QAAQ;YACJ,mHAAmH,EACvH,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,kCAAkC,EACjE,SAAS,CACZ,EACD,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,eAAe,KAC5B,KAAK;QAET,oBAAC,eAAe,CAAC,WAAW,IACxB,SAAS,EAAE,UAAU,CACjB,oFAAoF,EACpF,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,WAAW,EAC3C,yEAAyE,CAC5E,GACH,CACiB,CAC1B,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch_types.js","sourceRoot":"","sources":["../../../../../../../src/components/switch/switch_types.ts"],"names":[],"mappings":"AAAA,OAAiC,wBAAwB,CAAC"}
|
|
@@ -8,7 +8,7 @@ export const Tag = ({ className, label, variant = 'default', disabled = false, o
|
|
|
8
8
|
'aurora-pointer-events-none': disabled,
|
|
9
9
|
}), ...props, "aria-disabled": disabled },
|
|
10
10
|
React.createElement("span", null, label),
|
|
11
|
-
variant === 'deletable' && (React.createElement("button", { className: "aurora-bg-transparent hover:aurora-bg-active aurora-rounded-2 focus
|
|
11
|
+
variant === 'deletable' && (React.createElement("button", { className: "aurora-bg-transparent hover:aurora-bg-active aurora-rounded-2 focus", onClick: (e) => {
|
|
12
12
|
e.stopPropagation();
|
|
13
13
|
onDelete?.();
|
|
14
14
|
} },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../../../../../../src/components/tag/tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AACzC,OAA0B,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,GAAG,GAAwB,CAAC,EACrC,SAAS,EACT,KAAK,EACL,OAAO,GAAG,SAAS,EACnB,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,EAAE,CAAC,CACE,6BACI,SAAS,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE;QACzD,4BAA4B,EAAE,QAAQ;KACzC,CAAC,KACE,KAAK,mBACM,QAAQ;IAEvB,kCAAO,KAAK,CAAQ;IACnB,OAAO,KAAK,WAAW,IAAI,CACxB,gCACI,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../../../../../../src/components/tag/tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AACzC,OAA0B,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,GAAG,GAAwB,CAAC,EACrC,SAAS,EACT,KAAK,EACL,OAAO,GAAG,SAAS,EACnB,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,EAAE,CAAC,CACE,6BACI,SAAS,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE;QACzD,4BAA4B,EAAE,QAAQ;KACzC,CAAC,KACE,KAAK,mBACM,QAAQ;IAEvB,kCAAO,KAAK,CAAQ;IACnB,OAAO,KAAK,WAAW,IAAI,CACxB,gCACI,SAAS,EAAC,qEAAqE,EAC/E,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACX,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,QAAQ,EAAE,EAAE,CAAC;QACjB,CAAC;QAED,oBAAC,aAAa,IAAC,SAAS,EAAE,UAAU,CAAC,4DAA4D,EAAE,QAAQ,IAAI,sBAAsB,CAAC,GAAI,CACrI,CACZ,CACC,CACT,CAAC"}
|
|
@@ -4,7 +4,7 @@ export const tagVariants = cva('aurora-inline-flex aurora-gap-1 aurora-items-cen
|
|
|
4
4
|
variants: {
|
|
5
5
|
variant: {
|
|
6
6
|
[TAG_VARIANTS.default]: 'aurora-bg-subtle aurora-text-primary aurora-pr-2 aurora-pl-2',
|
|
7
|
-
[TAG_VARIANTS.clickable]: 'aurora-bg-subtle aurora-cursor-pointer aurora-pr-2 aurora-pl-2 hover:aurora-bg-active focus
|
|
7
|
+
[TAG_VARIANTS.clickable]: 'aurora-bg-subtle aurora-cursor-pointer aurora-pr-2 aurora-pl-2 hover:aurora-bg-active focus',
|
|
8
8
|
[TAG_VARIANTS.deletable]: 'aurora-bg-subtle',
|
|
9
9
|
},
|
|
10
10
|
disabled: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag_variants.js","sourceRoot":"","sources":["../../../../../../../src/components/tag/tag_variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAC1B,uJAAuJ,EACvJ;IACI,QAAQ,EAAE;QACN,OAAO,EAAE;YACL,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,8DAA8D;YACtF,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"tag_variants.js","sourceRoot":"","sources":["../../../../../../../src/components/tag/tag_variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAC1B,uJAAuJ,EACvJ;IACI,QAAQ,EAAE;QACN,OAAO,EAAE;YACL,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,8DAA8D;YACtF,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,6FAA6F;YACvH,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,kBAAkB;SAC/C;QACD,QAAQ,EAAE;YACN,IAAI,EAAE,8FAA8F;YACpG,KAAK,EAAE,EAAE;SACZ;KACJ;IACD,eAAe,EAAE;QACb,OAAO,EAAE,YAAY,CAAC,OAAO;KAChC;CACJ,CACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { slicedToArray as _slicedToArray } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { fuzzySearch } from '../../utilities/fuzzy_search.js';
|
|
4
|
+
|
|
5
|
+
var useSearch = function useSearch(_ref) {
|
|
6
|
+
var items = _ref.items,
|
|
7
|
+
searchKey = _ref.searchKey,
|
|
8
|
+
_ref$searchStrategy = _ref.searchStrategy,
|
|
9
|
+
searchStrategy = _ref$searchStrategy === void 0 ? fuzzySearch : _ref$searchStrategy;
|
|
10
|
+
var _useState = useState(items),
|
|
11
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
+
_items = _useState2[0],
|
|
13
|
+
setItems = _useState2[1];
|
|
14
|
+
var search = function search(query) {
|
|
15
|
+
setItems(searchStrategy(query, items, searchKey));
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
search: search,
|
|
19
|
+
items: _items
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { useSearch };
|
|
24
|
+
//# sourceMappingURL=use_search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare type TSearchItem = Record<string, any> | string;
|
|
2
|
+
export declare type TUseSearchProps<T extends TSearchItem = TSearchItem> = {
|
|
3
|
+
items: T[];
|
|
4
|
+
searchStrategy?: (query: string, items: T[], key?: string) => T[];
|
|
5
|
+
searchKey?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type TUseSearchApi<T extends TSearchItem = TSearchItem> = {
|
|
8
|
+
search(query: string): void;
|
|
9
|
+
items: T[];
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_search_types.js","sourceRoot":"","sources":["../../../../../../../src/hooks/search/use_search_types.ts"],"names":[],"mappings":""}
|
|
@@ -75,3 +75,10 @@ export { MessageBox } from "./components/message_box/message_box";
|
|
|
75
75
|
export { MESSAGE_BOX_VARIANTS, MESSAGE_BOX_ICON_COLORS, MESSAGE_BOX_ICONS } from "./components/message_box/message_box_constants";
|
|
76
76
|
export { HelperText } from './components/helper_text/helper_text';
|
|
77
77
|
export { ErrorList } from "./components/error_list/error_list";
|
|
78
|
+
export { Drawer } from "./components/drawer/drawer";
|
|
79
|
+
export { DrawerTrigger } from "./components/drawer/components/drawer_trigger";
|
|
80
|
+
export { DrawerContent } from "./components/drawer/components/drawer_content";
|
|
81
|
+
export { DrawerTitle } from "./components/drawer/components/drawer_title";
|
|
82
|
+
export { DrawerClose } from "./components/drawer/components/drawer_close";
|
|
83
|
+
export { DRAWER_DIRECTIONS } from "./components/drawer/drawer_constants";
|
|
84
|
+
export { useSearch } from "./hooks/search/use_search";
|
|
@@ -72,4 +72,11 @@ export { MESSAGE_BOX_ICONS, MESSAGE_BOX_ICON_COLORS, MESSAGE_BOX_VARIANTS } from
|
|
|
72
72
|
export { MessageBox } from './components/message_box/message_box.js';
|
|
73
73
|
export { HelperText } from './components/helper_text/helper_text.js';
|
|
74
74
|
export { ErrorList } from './components/error_list/error_list.js';
|
|
75
|
+
export { DRAWER_DIRECTIONS } from './components/drawer/drawer_constants.js';
|
|
76
|
+
export { Drawer } from './components/drawer/drawer.js';
|
|
77
|
+
export { DrawerTrigger } from './components/drawer/components/drawer_trigger.js';
|
|
78
|
+
export { DrawerContent } from './components/drawer/components/drawer_content.js';
|
|
79
|
+
export { DrawerClose } from './components/drawer/components/drawer_close.js';
|
|
80
|
+
export { DrawerTitle } from './components/drawer/components/drawer_title.js';
|
|
81
|
+
export { useSearch } from './hooks/search/use_search.js';
|
|
75
82
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare type TSearchItem = Record<string, any> | string;
|
|
2
|
+
/**
|
|
3
|
+
* searches within array of objects by given key, returns filtered array of objects using fuzzy algorithm
|
|
4
|
+
* @param {string} query - the phrase by which it searches
|
|
5
|
+
* @param {Array<Object>} arrayToFilter - array which will be searched
|
|
6
|
+
* @param {string} key - key of object within arrayToFilter where search should be used
|
|
7
|
+
* @example
|
|
8
|
+
* // returns [{id: 1, text: 'polish'}, {id: 2, text: 'portugal'}]
|
|
9
|
+
* fuzzySearch('pol', [
|
|
10
|
+
* {id: 1, text: 'polish'},
|
|
11
|
+
* {id: 2, text: 'portugal'},
|
|
12
|
+
* {id: 3, text: 'english'}
|
|
13
|
+
* ], 'text')
|
|
14
|
+
* @returns {Array} - filtered array
|
|
15
|
+
*/
|
|
16
|
+
export declare function fuzzySearch<T extends TSearchItem = TSearchItem>(query: string, arrayToFilter: T[], key?: string): T[];
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { toConsumableArray as _toConsumableArray } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import union from 'lodash/union';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* searches within array of objects by given key, returns filtered array of objects using fuzzy algorithm
|
|
6
|
+
* @param {string} query - the phrase by which it searches
|
|
7
|
+
* @param {Array<Object>} arrayToFilter - array which will be searched
|
|
8
|
+
* @param {string} key - key of object within arrayToFilter where search should be used
|
|
9
|
+
* @example
|
|
10
|
+
* // returns [{id: 1, text: 'polish'}, {id: 2, text: 'portugal'}]
|
|
11
|
+
* fuzzySearch('pol', [
|
|
12
|
+
* {id: 1, text: 'polish'},
|
|
13
|
+
* {id: 2, text: 'portugal'},
|
|
14
|
+
* {id: 3, text: 'english'}
|
|
15
|
+
* ], 'text')
|
|
16
|
+
* @returns {Array} - filtered array
|
|
17
|
+
*/
|
|
18
|
+
function fuzzySearch(query, arrayToFilter, key) {
|
|
19
|
+
if (query !== '' && query.search(/[-[\]/{}()*+?.\\^$|]/g) === -1) {
|
|
20
|
+
var exactSearch = new RegExp('^' + query + '$', 'i');
|
|
21
|
+
var firstSearch = new RegExp('^' + query, 'i');
|
|
22
|
+
var looseSearch = new RegExp('.*' + query + '.*', 'i');
|
|
23
|
+
var _fuzzySearch = new RegExp('(^' + query + ')|(' + query + ')|(' + query.replace(/\s+/g, '').split('').join('.*') + ')', 'i');
|
|
24
|
+
var exact = [];
|
|
25
|
+
var first = [];
|
|
26
|
+
var loose = [];
|
|
27
|
+
var fuzzy = [];
|
|
28
|
+
console.log('arrayToFilter', arrayToFilter);
|
|
29
|
+
console.log('key', key);
|
|
30
|
+
arrayToFilter.forEach(function (option) {
|
|
31
|
+
var searchBy = !key ? option.toString() : option[key].toString();
|
|
32
|
+
var textWithoutPolishSigns = searchBy.replace(/ę/gi, 'e').replace(/ó/gi, 'o').replace(/ą/gi, 'a').replace(/ś/gi, 's').replace(/ł/gi, 'l').replace(/ż/gi, 'z').replace(/ź/gi, 'z').replace(/ć/gi, 'c').replace(/ń/gi, 'n');
|
|
33
|
+
if (searchBy.match(exactSearch) || textWithoutPolishSigns.match(exactSearch)) {
|
|
34
|
+
exact.push(option);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (searchBy.match(firstSearch) || textWithoutPolishSigns.match(firstSearch)) {
|
|
38
|
+
first.push(option);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (searchBy.match(looseSearch) || textWithoutPolishSigns.match(looseSearch)) {
|
|
42
|
+
loose.push(option);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (searchBy.match(_fuzzySearch) || textWithoutPolishSigns.match(_fuzzySearch)) {
|
|
46
|
+
fuzzy.push(option);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return union(exact, first, loose, fuzzy);
|
|
51
|
+
} else {
|
|
52
|
+
return _toConsumableArray(arrayToFilter);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { fuzzySearch };
|
|
57
|
+
//# sourceMappingURL=fuzzy_search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|