@hintoric/ui 0.7.0 → 0.8.0
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/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroupContext.d.ts +17 -0
- package/dist/components/ButtonGroup/ButtonGroupContext.d.ts.map +1 -0
- package/dist/components/ButtonGroup/buttonGroupClasses.d.ts +12 -0
- package/dist/components/ButtonGroup/buttonGroupClasses.d.ts.map +1 -0
- package/dist/components/ButtonGroup/types.d.ts +12 -0
- package/dist/components/ButtonGroup/types.d.ts.map +1 -1
- package/dist/components/ButtonGroup/useButtonGroupItem.d.ts +32 -0
- package/dist/components/ButtonGroup/useButtonGroupItem.d.ts.map +1 -0
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroupContext.d.ts +12 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroupContext.d.ts.map +1 -0
- package/dist/components/ToggleButtonGroup/types.d.ts +2 -0
- package/dist/components/ToggleButtonGroup/types.d.ts.map +1 -1
- package/dist/index.js +3763 -3600
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/colorVariantClasses.d.ts +1 -0
- package/dist/utils/colorVariantClasses.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,MAAM,uFA0DjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAWhD,eAAO,MAAM,WAAW,yFA6CtB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JoyColor, JoyVariant } from '../../utils/colorVariantClasses';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* What a group hands down to its Buttons and IconButtons. Mirrors Joy's own
|
|
5
|
+
* `ButtonGroupContext`: Joy's Button.js and IconButton.js resolve each of these
|
|
6
|
+
* as `own prop || group || default`, which is why a Joy `<ToggleButtonGroup>`
|
|
7
|
+
* of bare `<Button>`s renders outlined/neutral rather than Button's own
|
|
8
|
+
* solid/primary default.
|
|
9
|
+
*/
|
|
10
|
+
export interface ButtonGroupContextValue {
|
|
11
|
+
variant?: JoyVariant;
|
|
12
|
+
color?: JoyColor;
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const ButtonGroupContext: React.Context<ButtonGroupContextValue>;
|
|
17
|
+
//# sourceMappingURL=ButtonGroupContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGroupContext.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/ButtonGroupContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,kBAAkB,wCAAmD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JoyColor, JoyVariant } from '../../utils/colorVariantClasses';
|
|
2
|
+
/** `spacing` 0 / "0px" / "0rem" connects the buttons — Joy's `/^0(?!\.)/` test. */
|
|
3
|
+
export declare function isConnected(spacing: number | string): boolean;
|
|
4
|
+
/** Joy's `theme.spacing(n)`: a number is a multiple of 8px, a string is used as-is. */
|
|
5
|
+
export declare function groupGap(spacing: number | string): string;
|
|
6
|
+
export declare function buttonGroupClasses({ variant, color, orientation, connected, }: {
|
|
7
|
+
variant: JoyVariant;
|
|
8
|
+
color: JoyColor;
|
|
9
|
+
orientation: 'horizontal' | 'vertical';
|
|
10
|
+
connected: boolean;
|
|
11
|
+
}): string;
|
|
12
|
+
//# sourceMappingURL=buttonGroupClasses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonGroupClasses.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/buttonGroupClasses.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AA0D5E,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAE7D;AAED,uFAAuF;AACvF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,KAAK,EACL,WAAW,EACX,SAAS,GACV,EAAE;IACD,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,QAAQ,CAAC;IAChB,WAAW,EAAE,YAAY,GAAG,UAAU,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,MAAM,CAgBT"}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
import { JoyColor, JoyVariant } from '../../utils/colorVariantClasses';
|
|
1
2
|
import type * as React from 'react';
|
|
2
3
|
export interface ButtonGroupProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
4
|
+
/** Passed down to every Button/IconButton in the group that doesn't set its own, as in Joy. */
|
|
5
|
+
variant?: JoyVariant;
|
|
6
|
+
/** Passed down to every Button/IconButton in the group that doesn't set its own, as in Joy. */
|
|
7
|
+
color?: JoyColor;
|
|
8
|
+
/** Passed down to every Button/IconButton in the group that doesn't set its own, as in Joy. */
|
|
9
|
+
size?: 'sm' | 'md' | 'lg';
|
|
3
10
|
orientation?: 'horizontal' | 'vertical';
|
|
11
|
+
/**
|
|
12
|
+
* Gap between the buttons. A number is a multiple of 8px (Joy's
|
|
13
|
+
* `theme.spacing`), a string is used as-is. 0 connects them.
|
|
14
|
+
*/
|
|
4
15
|
spacing?: number | string;
|
|
16
|
+
/** Disables every Button/IconButton in the group that doesn't set its own `disabled`. */
|
|
5
17
|
disabled?: boolean;
|
|
6
18
|
}
|
|
7
19
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE5E,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAC7E,+FAA+F;IAC/F,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,+FAA+F;IAC/F,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,+FAA+F;IAC/F,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,yFAAyF;IACzF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { JoyColor, JoyVariant } from '../../utils/colorVariantClasses';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface GroupItemProps {
|
|
4
|
+
variant?: JoyVariant;
|
|
5
|
+
color?: JoyColor;
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
value?: unknown;
|
|
9
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
10
|
+
'aria-pressed'?: React.AriaAttributes['aria-pressed'];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The props a Button or IconButton actually renders with once a surrounding
|
|
14
|
+
* group is taken into account — the same resolution Joy's Button.js and
|
|
15
|
+
* IconButton.js do: an explicit prop wins, then the group, then the
|
|
16
|
+
* component's own default. Inside a ToggleButtonGroup, `aria-pressed` follows
|
|
17
|
+
* the group's value and a click reports the button's `value` to it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useButtonGroupItem(props: GroupItemProps, defaults: {
|
|
20
|
+
variant: JoyVariant;
|
|
21
|
+
color: JoyColor;
|
|
22
|
+
size: 'sm' | 'md' | 'lg';
|
|
23
|
+
}): {
|
|
24
|
+
variant: JoyVariant;
|
|
25
|
+
color: JoyColor;
|
|
26
|
+
size: "sm" | "md" | "lg";
|
|
27
|
+
disabled: boolean | undefined;
|
|
28
|
+
'aria-pressed': boolean | "true" | "false" | "mixed" | undefined;
|
|
29
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=useButtonGroupItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useButtonGroupItem.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/useButtonGroupItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE5E,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;CACvD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAAE;;;;;;qBAWzD,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC;EAOvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,UAAU,2FAuCrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButtonGroup.d.ts","sourceRoot":"","sources":["../../../src/components/ToggleButtonGroup/ToggleButtonGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ToggleButtonGroup.d.ts","sourceRoot":"","sources":["../../../src/components/ToggleButtonGroup/ToggleButtonGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAgBtD,eAAO,MAAM,iBAAiB,+FAiE5B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Selection state a ToggleButtonGroup shares with its buttons. Through context
|
|
4
|
+
* rather than `cloneElement`, as in Joy, so a button wrapped in something (a
|
|
5
|
+
* Tooltip, say) still toggles and still renders pressed.
|
|
6
|
+
*/
|
|
7
|
+
export interface ToggleButtonGroupContextValue {
|
|
8
|
+
value: readonly unknown[];
|
|
9
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>, value: unknown) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const ToggleButtonGroupContext: React.Context<ToggleButtonGroupContextValue | undefined>;
|
|
12
|
+
//# sourceMappingURL=ToggleButtonGroupContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleButtonGroupContext.d.ts","sourceRoot":"","sources":["../../../src/components/ToggleButtonGroup/ToggleButtonGroupContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/E;AAED,eAAO,MAAM,wBAAwB,0DAA4E,CAAC"}
|
|
@@ -3,6 +3,8 @@ import type * as React from 'react';
|
|
|
3
3
|
export interface ToggleButtonGroupProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' | 'value' | 'defaultValue'> {
|
|
4
4
|
variant?: JoyVariant;
|
|
5
5
|
color?: JoyColor;
|
|
6
|
+
/** Passed down to every Button/IconButton in the group, as in Joy. */
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
8
|
orientation?: 'horizontal' | 'vertical';
|
|
7
9
|
spacing?: number | string;
|
|
8
10
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ToggleButtonGroup/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE5E,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,cAAc,CAAC;IAC1F,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,KAAK,CAAC,EAAE,QAAQ,C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