@fibery/ui-kit 9.0.1 → 9.0.2
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/actions-menu/actions-menu-item.js +1 -1
- package/lib/actions-menu/actions-menu-separator.d.ts +2 -2
- package/lib/actions-menu/index.d.ts +3 -3
- package/lib/antd/input-number.js +2 -2
- package/lib/antd/input.js +2 -2
- package/lib/board-table-loader.js +1 -1
- package/lib/card-container.js +1 -1
- package/lib/copy-to-clipboard.js +2 -1
- package/lib/date-picker/date-range-input.js +1 -1
- package/lib/date-picker/relative-date-picker.js +5 -3
- package/lib/date-picker/single-date-input.js +1 -1
- package/lib/date-picker/single-date-picker.d.ts +1 -2
- package/lib/date-picker/single-date-picker.js +2 -1
- package/lib/date-picker/types.d.ts +1 -2
- package/lib/design-system/alpha.d.ts +6 -0
- package/lib/design-system/alpha.js +6 -0
- package/lib/emoji-picker/app-icon-picker.d.ts +2 -2
- package/lib/emoji-picker/emoji-picker-content-with-color.d.ts +2 -2
- package/lib/emoji-picker/emoji-picker.d.ts +2 -2
- package/lib/emoji-picker/icon-emoji-picker.d.ts +1 -2
- package/lib/errors.d.ts +2 -3
- package/lib/guide-link.js +1 -1
- package/lib/icons/ast/build.d.ts +5 -0
- package/lib/icons/ast/build.js +25 -0
- package/lib/icons/ast/index.d.ts +2 -1
- package/lib/icons/ast/index.js +5 -4
- package/lib/icons/ast/spinner.js +7 -1
- package/lib/icons/react/build.d.ts +15 -0
- package/lib/icons/react/build.js +21 -0
- package/lib/icons/react/index.d.ts +2 -1
- package/lib/icons/react/index.js +5 -4
- package/lib/integration-compact-info-button.js +1 -2
- package/lib/is-in-popup.d.ts +1 -2
- package/lib/is-in-popup.js +6 -0
- package/lib/loaders.d.ts +1 -9
- package/lib/loaders.js +2 -39
- package/lib/loaders.wyw-in-js.css +2 -4
- package/lib/mobile-drawer.wyw-in-js.css +2 -2
- package/lib/popover/index.d.ts +5 -10
- package/lib/popover/index.js +11 -22
- package/lib/popover/mobile-popover.d.ts +2 -2
- package/lib/popover/popup-modifiers-context.d.ts +3 -5
- package/lib/select/components/drop-down-indicator.js +1 -1
- package/lib/select/components/menu-list-virtualized.js +1 -1
- package/lib/select/select-in-popover.js +1 -1
- package/lib/select/select.js +3 -3
- package/lib/select/styles.js +2 -2
- package/lib/spinner.d.ts +9 -0
- package/lib/spinner.js +13 -0
- package/lib/theme-settings-core.d.ts +13 -1
- package/lib/theme-settings-core.js +37 -1
- package/lib/theme-settings.d.ts +3 -2
- package/lib/theme-settings.js +7 -2
- package/lib/unit/primitive.js +6 -6
- package/lib/unit/primitive.wyw-in-js.css +2 -2
- package/lib/use-long-press.d.ts +6 -6
- package/lib/with-data.d.ts +35 -37
- package/lib/with-data.js +23 -22
- package/package.json +3 -3
- package/lib/beta-badge.d.ts +0 -8
- package/lib/beta-badge.js +0 -13
- package/lib/beta-badge.wyw-in-js.css +0 -1
- package/lib/checkbox-multi-select.d.ts +0 -21
- package/lib/checkbox-multi-select.js +0 -41
- package/lib/checkbox-multi-select.wyw-in-js.css +0 -3
- package/lib/country-selector.d.ts +0 -9
- package/lib/country-selector.js +0 -21
- package/lib/layout.d.ts +0 -28
- package/lib/layout.js +0 -66
- package/lib/layout.wyw-in-js.css +0 -2
- package/lib/new-card-placeholder.d.ts +0 -26
- package/lib/new-card-placeholder.js +0 -141
- package/lib/new-card-placeholder.wyw-in-js.css +0 -5
package/lib/with-data.d.ts
CHANGED
|
@@ -1,76 +1,74 @@
|
|
|
1
|
-
import { $TSFixMe } from "./tsfixme.js";
|
|
2
1
|
import { ComponentType } from "react";
|
|
3
2
|
//#region src/with-data.d.ts
|
|
4
|
-
type FetchState = {
|
|
3
|
+
type FetchState<Value = unknown> = {
|
|
5
4
|
fetchState: ":fetch-state/start";
|
|
6
5
|
fetchError: null;
|
|
7
6
|
fetchValue: null;
|
|
8
7
|
} | {
|
|
9
8
|
fetchState: ":fetch-state/success";
|
|
10
|
-
fetchValue:
|
|
9
|
+
fetchValue: Value;
|
|
11
10
|
fetchError: null;
|
|
12
11
|
} | {
|
|
13
12
|
fetchState: ":fetch-state/error";
|
|
14
13
|
fetchError: Error;
|
|
15
14
|
fetchValue: null;
|
|
16
15
|
};
|
|
17
|
-
type
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
type DataSources = Record<string, () => Promise<unknown>>;
|
|
17
|
+
type ProvidedState<Sources extends DataSources> = { [Key in keyof Sources]: FetchState<Awaited<ReturnType<Sources[Key]>>>; };
|
|
18
|
+
declare function provideData<Sources extends DataSources>({ sources }: {
|
|
19
|
+
sources: Sources;
|
|
20
|
+
}): <OwnProps extends object>(Component: ComponentType<OwnProps & ProvidedState<Sources>>) => {
|
|
21
|
+
new (props: OwnProps): {
|
|
22
|
+
state: ProvidedState<Sources>;
|
|
23
|
+
_prefetch: <Key extends keyof Sources>(key: Key, fetch: Sources[Key]) => Promise<void>;
|
|
24
|
+
setSourceState<Key extends keyof Sources>(key: Key, value: ProvidedState<Sources>[Key]): void;
|
|
26
25
|
componentDidMount(): void;
|
|
27
|
-
setStateIfMounted(updater: (prevState: ProvidedState) => ProvidedState): void;
|
|
26
|
+
setStateIfMounted(updater: (prevState: ProvidedState<Sources>) => ProvidedState<Sources>): void;
|
|
28
27
|
componentWillUnmount(): void;
|
|
29
28
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
30
29
|
context: unknown;
|
|
31
|
-
setState<K extends
|
|
30
|
+
setState<K extends keyof Sources>(state: Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | ((prevState: Readonly<ProvidedState<Sources>>, props: Readonly<OwnProps>) => Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | null) | null, callback?: (() => void) | undefined): void;
|
|
32
31
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
33
|
-
readonly props: Readonly<
|
|
32
|
+
readonly props: Readonly<OwnProps>;
|
|
34
33
|
refs: {
|
|
35
34
|
[key: string]: import("react").ReactInstance;
|
|
36
35
|
};
|
|
37
|
-
shouldComponentUpdate?(nextProps: Readonly<
|
|
36
|
+
shouldComponentUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): boolean;
|
|
38
37
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
39
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<
|
|
40
|
-
componentDidUpdate?(prevProps: Readonly<
|
|
38
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>): any;
|
|
39
|
+
componentDidUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>, snapshot?: any): void;
|
|
41
40
|
componentWillMount?(): void;
|
|
42
41
|
UNSAFE_componentWillMount?(): void;
|
|
43
|
-
componentWillReceiveProps?(nextProps: Readonly<
|
|
44
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<
|
|
45
|
-
componentWillUpdate?(nextProps: Readonly<
|
|
46
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<
|
|
42
|
+
componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
|
|
43
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
|
|
44
|
+
componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
|
|
45
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
|
|
47
46
|
};
|
|
48
|
-
new (props:
|
|
49
|
-
state:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
_prefetch: (key: string, fetch: () => Promise<$TSFixMe>) => Promise<void>;
|
|
47
|
+
new (props: OwnProps, context: any): {
|
|
48
|
+
state: ProvidedState<Sources>;
|
|
49
|
+
_prefetch: <Key extends keyof Sources>(key: Key, fetch: Sources[Key]) => Promise<void>;
|
|
50
|
+
setSourceState<Key extends keyof Sources>(key: Key, value: ProvidedState<Sources>[Key]): void;
|
|
53
51
|
componentDidMount(): void;
|
|
54
|
-
setStateIfMounted(updater: (prevState: ProvidedState) => ProvidedState): void;
|
|
52
|
+
setStateIfMounted(updater: (prevState: ProvidedState<Sources>) => ProvidedState<Sources>): void;
|
|
55
53
|
componentWillUnmount(): void;
|
|
56
54
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
57
55
|
context: unknown;
|
|
58
|
-
setState<K extends
|
|
56
|
+
setState<K extends keyof Sources>(state: Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | ((prevState: Readonly<ProvidedState<Sources>>, props: Readonly<OwnProps>) => Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | null) | null, callback?: (() => void) | undefined): void;
|
|
59
57
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
60
|
-
readonly props: Readonly<
|
|
58
|
+
readonly props: Readonly<OwnProps>;
|
|
61
59
|
refs: {
|
|
62
60
|
[key: string]: import("react").ReactInstance;
|
|
63
61
|
};
|
|
64
|
-
shouldComponentUpdate?(nextProps: Readonly<
|
|
62
|
+
shouldComponentUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): boolean;
|
|
65
63
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
66
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<
|
|
67
|
-
componentDidUpdate?(prevProps: Readonly<
|
|
64
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>): any;
|
|
65
|
+
componentDidUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>, snapshot?: any): void;
|
|
68
66
|
componentWillMount?(): void;
|
|
69
67
|
UNSAFE_componentWillMount?(): void;
|
|
70
|
-
componentWillReceiveProps?(nextProps: Readonly<
|
|
71
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<
|
|
72
|
-
componentWillUpdate?(nextProps: Readonly<
|
|
73
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<
|
|
68
|
+
componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
|
|
69
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
|
|
70
|
+
componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
|
|
71
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
|
|
74
72
|
};
|
|
75
73
|
contextType?: import("react").Context<any> | undefined;
|
|
76
74
|
};
|
package/lib/with-data.js
CHANGED
|
@@ -3,37 +3,38 @@ import { mapValues, noop } from "@fibery/helpers/src/_";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { PureComponent } from "react";
|
|
5
5
|
//#region src/with-data.tsx
|
|
6
|
+
var makeInitialState = (sources) => mapValues(sources, () => ({
|
|
7
|
+
fetchState: ":fetch-state/start",
|
|
8
|
+
fetchValue: null,
|
|
9
|
+
fetchError: null
|
|
10
|
+
}));
|
|
6
11
|
function provideData({ sources }) {
|
|
7
12
|
return (Component) => class DataProvider extends PureComponent {
|
|
8
|
-
state =
|
|
9
|
-
fetchState: ":fetch-state/start",
|
|
10
|
-
fetchValue: null,
|
|
11
|
-
fetchError: null
|
|
12
|
-
}));
|
|
13
|
+
state = makeInitialState(sources);
|
|
13
14
|
_prefetch = async (key, fetch) => {
|
|
14
15
|
try {
|
|
15
16
|
const fetchValue = await fetch();
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
fetchError: null
|
|
22
|
-
}
|
|
23
|
-
}));
|
|
17
|
+
this.setSourceState(key, {
|
|
18
|
+
fetchState: ":fetch-state/success",
|
|
19
|
+
fetchValue,
|
|
20
|
+
fetchError: null
|
|
21
|
+
});
|
|
24
22
|
} catch (fetchError) {
|
|
25
|
-
this.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
fetchError: asError(fetchError)
|
|
31
|
-
}
|
|
32
|
-
}));
|
|
23
|
+
this.setSourceState(key, {
|
|
24
|
+
fetchState: ":fetch-state/error",
|
|
25
|
+
fetchValue: null,
|
|
26
|
+
fetchError: asError(fetchError)
|
|
27
|
+
});
|
|
33
28
|
}
|
|
34
29
|
};
|
|
30
|
+
setSourceState(key, value) {
|
|
31
|
+
this.setStateIfMounted((state) => ({
|
|
32
|
+
...state,
|
|
33
|
+
[key]: value
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
35
36
|
componentDidMount() {
|
|
36
|
-
Object.
|
|
37
|
+
Object.keys(sources).forEach((key) => this._prefetch(key, sources[key]));
|
|
37
38
|
}
|
|
38
39
|
setStateIfMounted(updater) {
|
|
39
40
|
return this.setState(updater);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/ui-kit",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.2",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
@@ -147,8 +147,8 @@
|
|
|
147
147
|
"vaul": "1.1.2",
|
|
148
148
|
"virtua": "0.48.8",
|
|
149
149
|
"@fibery/emoji-data": "3.0.0",
|
|
150
|
-
"@fibery/
|
|
151
|
-
"@fibery/
|
|
150
|
+
"@fibery/react": "2.0.0",
|
|
151
|
+
"@fibery/helpers": "3.2.1"
|
|
152
152
|
},
|
|
153
153
|
"peerDependencies": {
|
|
154
154
|
"react": "18.3.1",
|
package/lib/beta-badge.d.ts
DELETED
package/lib/beta-badge.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import "./beta-badge.wyw-in-js.css";
|
|
2
|
-
import { textClasses } from "./design-system/typography.js";
|
|
3
|
-
/* empty css */
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { cx } from "@linaria/core";
|
|
6
|
-
//#region src/beta-badge.tsx
|
|
7
|
-
var betaBadgeStyle = "b15i7tcu-betaBadge";
|
|
8
|
-
var BetaBadge = ({ children, className }) => /* @__PURE__ */ jsx("span", {
|
|
9
|
-
className: cx(textClasses.heading8, betaBadgeStyle, className),
|
|
10
|
-
children
|
|
11
|
-
});
|
|
12
|
-
//#endregion
|
|
13
|
-
export { BetaBadge };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.b15i7tcu-betaBadge{display:inline-block;padding:2px 5px;color:var(--colorAI);background-color:var(--colorBgAI);vertical-align:text-top;border-radius:4px;}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Theme } from "./design-system/theme.js";
|
|
2
|
-
import "./design-system.js";
|
|
3
|
-
import { FC } from "react";
|
|
4
|
-
//#region src/checkbox-multi-select.d.ts
|
|
5
|
-
type Option = {
|
|
6
|
-
color?: string;
|
|
7
|
-
label?: string;
|
|
8
|
-
title?: string;
|
|
9
|
-
checked?: boolean;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
onToggle: () => void;
|
|
12
|
-
};
|
|
13
|
-
interface CheckboxMultiSelectProps {
|
|
14
|
-
theme: Theme;
|
|
15
|
-
color?: string;
|
|
16
|
-
options: Option[];
|
|
17
|
-
}
|
|
18
|
-
declare const CheckboxMultiSelect: FC<CheckboxMultiSelectProps>;
|
|
19
|
-
declare const ThemedCheckboxMultiSelect: FC<Omit<CheckboxMultiSelectProps, "theme">>;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { CheckboxMultiSelect, ThemedCheckboxMultiSelect };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import "./checkbox-multi-select.wyw-in-js.css";
|
|
2
|
-
import { textClasses } from "./design-system/typography.js";
|
|
3
|
-
import { useTheme } from "./theme-provider.js";
|
|
4
|
-
import { Checkbox } from "./checkbox.js";
|
|
5
|
-
/* empty css */
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { cx } from "@linaria/core";
|
|
8
|
-
//#region src/checkbox-multi-select.tsx
|
|
9
|
-
var labelStyle = "l1h8scft-label";
|
|
10
|
-
var labelWrapperStyle = "l1lwjtjf-labelWrapper";
|
|
11
|
-
var optionsWrapperStyle = "oa8vb22-optionsWrapper";
|
|
12
|
-
var CheckboxMultiSelect = ({ options, color, theme }) => {
|
|
13
|
-
return /* @__PURE__ */ jsx("div", {
|
|
14
|
-
className: optionsWrapperStyle,
|
|
15
|
-
children: options.map(({ checked, onToggle, label, disabled, title, color: optionColor }, index) => {
|
|
16
|
-
return /* @__PURE__ */ jsxs("label", {
|
|
17
|
-
style: { cursor: disabled ? "not-allowed" : "pointer" },
|
|
18
|
-
className: labelWrapperStyle,
|
|
19
|
-
title,
|
|
20
|
-
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
21
|
-
checked,
|
|
22
|
-
onChange: onToggle,
|
|
23
|
-
disabled,
|
|
24
|
-
color: optionColor || color || theme.colors.colorAccent
|
|
25
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
26
|
-
className: cx(textClasses.regular, labelStyle),
|
|
27
|
-
children: label
|
|
28
|
-
})]
|
|
29
|
-
}, index);
|
|
30
|
-
})
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
var ThemedCheckboxMultiSelect = (props) => {
|
|
34
|
-
const theme = useTheme();
|
|
35
|
-
return /* @__PURE__ */ jsx(CheckboxMultiSelect, {
|
|
36
|
-
...props,
|
|
37
|
-
theme
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
//#endregion
|
|
41
|
-
export { CheckboxMultiSelect, ThemedCheckboxMultiSelect };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
//#region src/country-selector.d.ts
|
|
3
|
-
interface CountrySelectorProps {
|
|
4
|
-
value?: string;
|
|
5
|
-
onChange?: (value: string) => void;
|
|
6
|
-
}
|
|
7
|
-
declare const CountrySelector: FC<CountrySelectorProps>;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { CountrySelector };
|
package/lib/country-selector.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Select } from "./select/index.js";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import countryList from "react-select-country-list";
|
|
4
|
-
//#region src/country-selector.tsx
|
|
5
|
-
var restrictedCountries = "RU,BY,KP,SY,IR,SD,CU".split(",");
|
|
6
|
-
var options = countryList().getData().filter((x) => !restrictedCountries.includes(x.value));
|
|
7
|
-
var countryMap = /* @__PURE__ */ new Map();
|
|
8
|
-
options.forEach((option) => {
|
|
9
|
-
countryMap.set(option.value, option);
|
|
10
|
-
});
|
|
11
|
-
var CountrySelector = ({ onChange = () => null, value }) => {
|
|
12
|
-
return /* @__PURE__ */ jsx(Select, {
|
|
13
|
-
isSearchable: true,
|
|
14
|
-
options,
|
|
15
|
-
value: countryMap.get(value) ?? null,
|
|
16
|
-
placeholder: "Select your country",
|
|
17
|
-
onChange: ({ value }) => onChange(value)
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
export { CountrySelector };
|
package/lib/layout.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
//#region src/layout.d.ts
|
|
3
|
-
declare const verticalAlignmentsToAlignItems: {
|
|
4
|
-
top: string;
|
|
5
|
-
center: string;
|
|
6
|
-
bottom: string;
|
|
7
|
-
};
|
|
8
|
-
declare const verticalAlignments: Array<keyof typeof verticalAlignmentsToAlignItems>;
|
|
9
|
-
interface HStackProps extends ComponentProps<"div"> {
|
|
10
|
-
alignment: keyof typeof verticalAlignmentsToAlignItems;
|
|
11
|
-
spacing?: number;
|
|
12
|
-
padding?: number;
|
|
13
|
-
}
|
|
14
|
-
declare const HStack: import("react").ForwardRefExoticComponent<Omit<HStackProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
-
declare const horizontalAlignmentsToAlignItems: {
|
|
16
|
-
leading: string;
|
|
17
|
-
center: string;
|
|
18
|
-
trailing: string;
|
|
19
|
-
};
|
|
20
|
-
declare const horizontalAlignments: Array<keyof typeof horizontalAlignmentsToAlignItems>;
|
|
21
|
-
interface VStackProps extends ComponentProps<"div"> {
|
|
22
|
-
alignment: keyof typeof horizontalAlignmentsToAlignItems;
|
|
23
|
-
spacing?: number;
|
|
24
|
-
padding?: number;
|
|
25
|
-
}
|
|
26
|
-
declare const VStack: import("react").ForwardRefExoticComponent<Omit<VStackProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { HStack, VStack, horizontalAlignments, verticalAlignments };
|
package/lib/layout.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import "./layout.wyw-in-js.css";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { forwardRef } from "react";
|
|
5
|
-
import { styled } from "@linaria/react";
|
|
6
|
-
//#region src/layout.tsx
|
|
7
|
-
var verticalAlignmentsToAlignItems = {
|
|
8
|
-
top: "flex-start",
|
|
9
|
-
center: "center",
|
|
10
|
-
bottom: "flex-end"
|
|
11
|
-
};
|
|
12
|
-
var verticalAlignments = Object.keys(verticalAlignmentsToAlignItems);
|
|
13
|
-
var _exp = () => (({ alignItemsType }) => alignItemsType);
|
|
14
|
-
var _exp2 = () => (({ paddingStyle = 0 }) => paddingStyle);
|
|
15
|
-
var _exp3 = () => (({ spacingStyle = 0 }) => spacingStyle);
|
|
16
|
-
var HStackStyle = /*#__PURE__*/ styled("div")({
|
|
17
|
-
name: "HStackStyle",
|
|
18
|
-
class: "highyvt-HStack",
|
|
19
|
-
propsAsIs: false,
|
|
20
|
-
vars: {
|
|
21
|
-
"highyvt-0": [_exp()],
|
|
22
|
-
"highyvt-1": [_exp2(), "px"],
|
|
23
|
-
"highyvt-2": [_exp3(), "px"]
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
var HStack = forwardRef(({ alignment, spacing, padding, children, ...rest }, ref) => {
|
|
27
|
-
return /* @__PURE__ */ jsx(HStackStyle, {
|
|
28
|
-
ref,
|
|
29
|
-
alignItemsType: verticalAlignmentsToAlignItems[alignment],
|
|
30
|
-
paddingStyle: padding,
|
|
31
|
-
spacingStyle: spacing,
|
|
32
|
-
...rest,
|
|
33
|
-
children
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
var horizontalAlignmentsToAlignItems = {
|
|
37
|
-
leading: "flex-start",
|
|
38
|
-
center: "center",
|
|
39
|
-
trailing: "flex-end"
|
|
40
|
-
};
|
|
41
|
-
var horizontalAlignments = Object.keys(horizontalAlignmentsToAlignItems);
|
|
42
|
-
var _exp4 = () => (({ alignItemsType }) => alignItemsType);
|
|
43
|
-
var _exp5 = () => (({ paddingStyle = 0 }) => paddingStyle);
|
|
44
|
-
var _exp6 = () => (({ spacingStyle = 0 }) => spacingStyle);
|
|
45
|
-
var VStackStyle = /*#__PURE__*/ styled("div")({
|
|
46
|
-
name: "VStackStyle",
|
|
47
|
-
class: "vsoocrd-VStack",
|
|
48
|
-
propsAsIs: false,
|
|
49
|
-
vars: {
|
|
50
|
-
"vsoocrd-0": [_exp4()],
|
|
51
|
-
"vsoocrd-1": [_exp5(), "px"],
|
|
52
|
-
"vsoocrd-2": [_exp6(), "px"]
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
var VStack = forwardRef(({ alignment, spacing, children, padding, ...rest }, ref) => {
|
|
56
|
-
return /* @__PURE__ */ jsx(VStackStyle, {
|
|
57
|
-
ref,
|
|
58
|
-
alignItemsType: horizontalAlignmentsToAlignItems[alignment],
|
|
59
|
-
paddingStyle: padding,
|
|
60
|
-
spacingStyle: spacing,
|
|
61
|
-
...rest,
|
|
62
|
-
children
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
//#endregion
|
|
66
|
-
export { HStack, VStack, horizontalAlignments, verticalAlignments };
|
package/lib/layout.wyw-in-js.css
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.highyvt-HStack{display:flex;flex-direction:row;align-items:var(--highyvt-0);padding:var(--highyvt-1);}.highyvt-HStack>*+*{margin-left:var(--highyvt-2);}
|
|
2
|
-
.vsoocrd-VStack{display:flex;flex-direction:column;align-items:var(--vsoocrd-0);padding:var(--vsoocrd-1);}.vsoocrd-VStack>*+*{margin-top:var(--vsoocrd-2);}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { $TSFixMe } from "./tsfixme.js";
|
|
2
|
-
import { CardSize } from "./card-container.js";
|
|
3
|
-
import { CSSProperties, FC, ReactNode, RefObject } from "react";
|
|
4
|
-
//#region src/new-card-placeholder.d.ts
|
|
5
|
-
declare const outlineNoneClassName: import("@linaria/core").LinariaClassName;
|
|
6
|
-
interface NewCardPlaceholderProps {
|
|
7
|
-
typeTitle?: string;
|
|
8
|
-
size: CardSize;
|
|
9
|
-
containerClassName?: string;
|
|
10
|
-
inputStyle?: CSSProperties;
|
|
11
|
-
leftContainer?: ReactNode;
|
|
12
|
-
scrollToInput?: boolean;
|
|
13
|
-
bypassedRef: RefObject<HTMLDivElement>;
|
|
14
|
-
referenceSelector?: ReactNode;
|
|
15
|
-
selectorOpen?: boolean;
|
|
16
|
-
readOnly?: boolean;
|
|
17
|
-
onSubmit: (v: {
|
|
18
|
-
event: $TSFixMe;
|
|
19
|
-
title: string;
|
|
20
|
-
}) => Promise<void>;
|
|
21
|
-
onHide: () => void;
|
|
22
|
-
onHideByEsc?: () => void;
|
|
23
|
-
}
|
|
24
|
-
declare const NewCardPlaceholder: FC<NewCardPlaceholderProps>;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { NewCardPlaceholder, outlineNoneClassName };
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import "./new-card-placeholder.wyw-in-js.css";
|
|
2
|
-
import { textStyles } from "./design-system/typography.js";
|
|
3
|
-
import { AntTransparentInput, AntTransparentTextArea } from "./antd/input.js";
|
|
4
|
-
import { Box } from "./box.js";
|
|
5
|
-
import { Button } from "./button/button.js";
|
|
6
|
-
import { CardContainer, titleUnitsContainerClassName } from "./card-container.js";
|
|
7
|
-
import { ignoreEnter } from "./form-utils.js";
|
|
8
|
-
/* empty css */
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { useCallback, useEffect, useState } from "react";
|
|
11
|
-
import cx from "classnames";
|
|
12
|
-
import { styled } from "@linaria/react";
|
|
13
|
-
import { useFocusOutside } from "@fibery/react/src/use-focus-outside";
|
|
14
|
-
//#region src/new-card-placeholder.tsx
|
|
15
|
-
var disabledTextClassName = "d147c4dk-disabledText";
|
|
16
|
-
var titleAreaContainerClassName = "t11jol8j-titleAreaContainer";
|
|
17
|
-
var _exp4 = () => (({ backgroundColor }) => backgroundColor || "");
|
|
18
|
-
var AuxWrapper = /*#__PURE__*/ styled("div")({
|
|
19
|
-
name: "AuxWrapper",
|
|
20
|
-
class: "asb1482-AuxWrapper",
|
|
21
|
-
propsAsIs: false,
|
|
22
|
-
vars: { "asb1482-0": [_exp4()] }
|
|
23
|
-
});
|
|
24
|
-
var singleLineClassName = "sxvk75e-singleLine";
|
|
25
|
-
var autosize = {
|
|
26
|
-
minRows: 1,
|
|
27
|
-
maxRows: 10
|
|
28
|
-
};
|
|
29
|
-
var outlineNoneClassName = "o1l7moht-outlineNone";
|
|
30
|
-
var NewCardPlaceholder = (props) => {
|
|
31
|
-
const { leftContainer, typeTitle, containerClassName, inputStyle, bypassedRef, onSubmit, onHide, onHideByEsc = onHide, referenceSelector, selectorOpen, readOnly, scrollToInput = true, size } = props;
|
|
32
|
-
const [title, setTitle] = useState("");
|
|
33
|
-
const multiline = size !== ":card-size/timeline" && size !== ":card-size/list" && size !== ":card-size/cell";
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (readOnly) bypassedRef.current?.focus();
|
|
36
|
-
}, [bypassedRef, readOnly]);
|
|
37
|
-
const onChange = useCallback((e) => {
|
|
38
|
-
setTitle(e.target.value);
|
|
39
|
-
e.stopPropagation();
|
|
40
|
-
}, []);
|
|
41
|
-
const submit = useCallback(async (event) => {
|
|
42
|
-
setTitle("");
|
|
43
|
-
try {
|
|
44
|
-
await onSubmit({
|
|
45
|
-
event,
|
|
46
|
-
title
|
|
47
|
-
});
|
|
48
|
-
} catch (e) {}
|
|
49
|
-
}, [onSubmit, title]);
|
|
50
|
-
const onPressEnter = useCallback(async (e) => {
|
|
51
|
-
e.stopPropagation();
|
|
52
|
-
submit(e);
|
|
53
|
-
}, [submit]);
|
|
54
|
-
const onBlur = useCallback(async (e) => {
|
|
55
|
-
if (!selectorOpen) {
|
|
56
|
-
if (title) submit(e);
|
|
57
|
-
onHide();
|
|
58
|
-
}
|
|
59
|
-
}, [
|
|
60
|
-
onHide,
|
|
61
|
-
selectorOpen,
|
|
62
|
-
submit,
|
|
63
|
-
title
|
|
64
|
-
]);
|
|
65
|
-
const hasTitle = title.length > 0;
|
|
66
|
-
const onKeyDown = useCallback((e) => {
|
|
67
|
-
ignoreEnter(e);
|
|
68
|
-
if (e.key === "Escape") {
|
|
69
|
-
e.stopPropagation();
|
|
70
|
-
if (hasTitle) setTitle("");
|
|
71
|
-
else onHideByEsc();
|
|
72
|
-
}
|
|
73
|
-
}, [hasTitle, onHideByEsc]);
|
|
74
|
-
const onAddCardButtonClick = useCallback((e) => {
|
|
75
|
-
submit(e);
|
|
76
|
-
}, [submit]);
|
|
77
|
-
const [containerElement, setContainerElement] = useState(null);
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
if (containerElement && scrollToInput) containerElement.scrollIntoView({
|
|
80
|
-
behavior: "smooth",
|
|
81
|
-
block: "center",
|
|
82
|
-
inline: "nearest"
|
|
83
|
-
});
|
|
84
|
-
}, [
|
|
85
|
-
containerElement,
|
|
86
|
-
title === "",
|
|
87
|
-
scrollToInput
|
|
88
|
-
]);
|
|
89
|
-
const { onBlurCapture, onFocusCapture } = useFocusOutside(onBlur);
|
|
90
|
-
return /* @__PURE__ */ jsx(Box, {
|
|
91
|
-
focused: true,
|
|
92
|
-
hovered: false,
|
|
93
|
-
ref: setContainerElement,
|
|
94
|
-
className: containerClassName,
|
|
95
|
-
onBlurCapture,
|
|
96
|
-
onFocusCapture,
|
|
97
|
-
children: jsx(CardContainer, {
|
|
98
|
-
before: leftContainer && /* @__PURE__ */ jsx("div", { children: leftContainer }),
|
|
99
|
-
title: readOnly ? /* @__PURE__ */ jsx("div", {
|
|
100
|
-
ref: bypassedRef,
|
|
101
|
-
tabIndex: 0,
|
|
102
|
-
className: titleUnitsContainerClassName,
|
|
103
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
104
|
-
className: cx(disabledTextClassName, outlineNoneClassName, { [singleLineClassName]: !multiline }),
|
|
105
|
-
children: "Name will be generated by a formula"
|
|
106
|
-
})
|
|
107
|
-
}) : /* @__PURE__ */ jsx("div", {
|
|
108
|
-
className: titleAreaContainerClassName,
|
|
109
|
-
children: /* @__PURE__ */ jsx(multiline ? AntTransparentTextArea : AntTransparentInput, {
|
|
110
|
-
bypassedRef,
|
|
111
|
-
value: title,
|
|
112
|
-
readOnly: false,
|
|
113
|
-
onChange,
|
|
114
|
-
onPressEnter,
|
|
115
|
-
autoFocus: true,
|
|
116
|
-
onKeyDown,
|
|
117
|
-
placeholder: readOnly ? "" : `New ${typeTitle}`,
|
|
118
|
-
style: {
|
|
119
|
-
...textStyles.regular,
|
|
120
|
-
...inputStyle
|
|
121
|
-
},
|
|
122
|
-
...multiline ? { autoSize: autosize } : {}
|
|
123
|
-
})
|
|
124
|
-
}),
|
|
125
|
-
size,
|
|
126
|
-
after: (referenceSelector || readOnly) && /* @__PURE__ */ jsxs(AuxWrapper, { children: [
|
|
127
|
-
referenceSelector && /* @__PURE__ */ jsx("div", { children: referenceSelector }),
|
|
128
|
-
readOnly && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
|
|
129
|
-
style: { width: 40 },
|
|
130
|
-
size: "small",
|
|
131
|
-
onClick: onAddCardButtonClick,
|
|
132
|
-
children: "Add"
|
|
133
|
-
}) }),
|
|
134
|
-
multiline && /* @__PURE__ */ jsx("div", {})
|
|
135
|
-
] }),
|
|
136
|
-
input: !readOnly
|
|
137
|
-
})
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
//#endregion
|
|
141
|
-
export { NewCardPlaceholder, outlineNoneClassName };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
.d147c4dk-disabledText{color:var(--disabledTextColor);}
|
|
2
|
-
.t11jol8j-titleAreaContainer{width:100%;}
|
|
3
|
-
.asb1482-AuxWrapper{display:flex;gap:4px;background-color:var(--asb1482-0);}
|
|
4
|
-
.sxvk75e-singleLine{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
|
5
|
-
.o1l7moht-outlineNone{outline:none;}
|