fox-ui-kit 0.0.0-stage → 0.1.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.
Files changed (181) hide show
  1. package/LICENSE +36 -0
  2. package/NOTICE +12 -0
  3. package/README.md +168 -3
  4. package/dist/button/CButton/index.d.ts +12 -0
  5. package/dist/button/CButton/index.js +67 -0
  6. package/dist/button/index.d.ts +2 -0
  7. package/dist/button/index.js +13 -0
  8. package/dist/card/CCard/index.d.ts +8 -0
  9. package/dist/card/CCard/index.js +53 -0
  10. package/dist/card/index.d.ts +2 -0
  11. package/dist/card/index.js +13 -0
  12. package/dist/data-display/ActivityItem/index.d.ts +8 -0
  13. package/dist/data-display/ActivityItem/index.js +37 -0
  14. package/dist/data-display/Avatars/index.d.ts +52 -0
  15. package/dist/data-display/Avatars/index.js +111 -0
  16. package/dist/data-display/Person/index.d.ts +14 -0
  17. package/dist/data-display/Person/index.js +64 -0
  18. package/dist/data-display/index.d.ts +6 -0
  19. package/dist/data-display/index.js +27 -0
  20. package/dist/disposition/Container/index.d.ts +6 -0
  21. package/dist/disposition/Container/index.js +113 -0
  22. package/dist/disposition/Flex/index.d.ts +140 -0
  23. package/dist/disposition/Flex/index.js +89 -0
  24. package/dist/disposition/FlexItem/index.d.ts +114 -0
  25. package/dist/disposition/FlexItem/index.js +55 -0
  26. package/dist/disposition/FlexSpace/index.d.ts +26 -0
  27. package/dist/disposition/FlexSpace/index.js +153 -0
  28. package/dist/disposition/ResponsiveSpace/index.d.ts +8 -0
  29. package/dist/disposition/ResponsiveSpace/index.js +40 -0
  30. package/dist/disposition/Space/index.d.ts +32 -0
  31. package/dist/disposition/Space/index.js +63 -0
  32. package/dist/disposition/index.d.ts +12 -0
  33. package/dist/disposition/index.js +48 -0
  34. package/dist/error/ErrorBoundary/index.d.ts +34 -0
  35. package/dist/error/ErrorBoundary/index.js +103 -0
  36. package/dist/error/ErrorWrapper/index.d.ts +184 -0
  37. package/dist/error/ErrorWrapper/index.js +171 -0
  38. package/dist/error/index.d.ts +4 -0
  39. package/dist/error/index.js +20 -0
  40. package/dist/helpers/UIUtils.d.ts +7 -0
  41. package/dist/helpers/UIUtils.js +32 -0
  42. package/dist/helpers/Utils.d.ts +75 -0
  43. package/dist/helpers/Utils.js +184 -0
  44. package/dist/helpers/index.d.ts +4 -0
  45. package/dist/helpers/index.js +49 -0
  46. package/dist/helpers/useBackendCallConfirm.d.ts +11 -0
  47. package/dist/helpers/useBackendCallConfirm.js +41 -0
  48. package/dist/helpers/useRoutesMatcher.d.ts +6 -0
  49. package/dist/helpers/useRoutesMatcher.js +52 -0
  50. package/dist/index.d.ts +15 -0
  51. package/dist/index.js +148 -0
  52. package/dist/input/AutocompleteInput/index.d.ts +5 -0
  53. package/dist/input/AutocompleteInput/index.js +28 -0
  54. package/dist/input/RemoteSelect/index.d.ts +24 -0
  55. package/dist/input/RemoteSelect/index.js +111 -0
  56. package/dist/input/TagInput/index.d.ts +52 -0
  57. package/dist/input/TagInput/index.js +340 -0
  58. package/dist/input/index.d.ts +6 -0
  59. package/dist/input/index.js +35 -0
  60. package/dist/interfaces/IDesignProviderContext.d.ts +8 -0
  61. package/dist/interfaces/IDesignProviderContext.js +1 -0
  62. package/dist/interfaces/IError.d.ts +9 -0
  63. package/dist/interfaces/IError.js +1 -0
  64. package/dist/interfaces/index.d.ts +1 -0
  65. package/dist/interfaces/index.js +1 -0
  66. package/dist/layout/PageHeaderWrapper/index.d.ts +15 -0
  67. package/dist/layout/PageHeaderWrapper/index.js +66 -0
  68. package/dist/layout/index.d.ts +2 -0
  69. package/dist/layout/index.js +13 -0
  70. package/dist/modal/DetailsModal/index.d.ts +10 -0
  71. package/dist/modal/DetailsModal/index.js +58 -0
  72. package/dist/modal/FormModal/index.d.ts +10 -0
  73. package/dist/modal/FormModal/index.js +61 -0
  74. package/dist/modal/PromptConfirm/index.d.ts +14 -0
  75. package/dist/modal/PromptConfirm/index.js +69 -0
  76. package/dist/modal/index.d.ts +6 -0
  77. package/dist/modal/index.js +27 -0
  78. package/dist/providers/DesignProvider.d.ts +29 -0
  79. package/dist/providers/DesignProvider.js +81 -0
  80. package/dist/ready-to-use/index.d.ts +1 -0
  81. package/dist/ready-to-use/index.js +16 -0
  82. package/dist/ready-to-use/marketing/index.d.ts +1 -0
  83. package/dist/ready-to-use/marketing/index.js +16 -0
  84. package/dist/ready-to-use/marketing/sections/blog/BlogPost.d.ts +193 -0
  85. package/dist/ready-to-use/marketing/sections/blog/BlogPost.js +131 -0
  86. package/dist/ready-to-use/marketing/sections/blog/BlogPostAuthor.d.ts +20 -0
  87. package/dist/ready-to-use/marketing/sections/blog/BlogPostAuthor.js +78 -0
  88. package/dist/ready-to-use/marketing/sections/blog/BlogPostTag.d.ts +14 -0
  89. package/dist/ready-to-use/marketing/sections/blog/BlogPostTag.js +38 -0
  90. package/dist/ready-to-use/marketing/sections/blog/index.d.ts +4 -0
  91. package/dist/ready-to-use/marketing/sections/blog/index.js +20 -0
  92. package/dist/ready-to-use/marketing/sections/components/SectionTitle.d.ts +100 -0
  93. package/dist/ready-to-use/marketing/sections/components/SectionTitle.js +88 -0
  94. package/dist/ready-to-use/marketing/sections/components/index.d.ts +2 -0
  95. package/dist/ready-to-use/marketing/sections/components/index.js +13 -0
  96. package/dist/ready-to-use/marketing/sections/features/FeatureIcon.d.ts +44 -0
  97. package/dist/ready-to-use/marketing/sections/features/FeatureIcon.js +38 -0
  98. package/dist/ready-to-use/marketing/sections/features/FeatureItem.d.ts +74 -0
  99. package/dist/ready-to-use/marketing/sections/features/FeatureItem.js +66 -0
  100. package/dist/ready-to-use/marketing/sections/features/FeatureItemBorderLeft.d.ts +118 -0
  101. package/dist/ready-to-use/marketing/sections/features/FeatureItemBorderLeft.js +81 -0
  102. package/dist/ready-to-use/marketing/sections/features/FeatureItemIconLeft.d.ts +74 -0
  103. package/dist/ready-to-use/marketing/sections/features/FeatureItemIconLeft.js +69 -0
  104. package/dist/ready-to-use/marketing/sections/features/index.d.ts +8 -0
  105. package/dist/ready-to-use/marketing/sections/features/index.js +34 -0
  106. package/dist/ready-to-use/marketing/sections/hero/cards/HeroCard.d.ts +77 -0
  107. package/dist/ready-to-use/marketing/sections/hero/cards/HeroCard.js +68 -0
  108. package/dist/ready-to-use/marketing/sections/hero/cards/HeroCardBackground.d.ts +95 -0
  109. package/dist/ready-to-use/marketing/sections/hero/cards/HeroCardBackground.js +88 -0
  110. package/dist/ready-to-use/marketing/sections/hero/cards/HeroCardImageBottom.d.ts +129 -0
  111. package/dist/ready-to-use/marketing/sections/hero/cards/HeroCardImageBottom.js +97 -0
  112. package/dist/ready-to-use/marketing/sections/hero/cards/HeroCardImageLeft.d.ts +113 -0
  113. package/dist/ready-to-use/marketing/sections/hero/cards/HeroCardImageLeft.js +89 -0
  114. package/dist/ready-to-use/marketing/sections/hero/cards/HeroCardImageRight.d.ts +113 -0
  115. package/dist/ready-to-use/marketing/sections/hero/cards/HeroCardImageRight.js +89 -0
  116. package/dist/ready-to-use/marketing/sections/hero/cards/index.d.ts +10 -0
  117. package/dist/ready-to-use/marketing/sections/hero/cards/index.js +41 -0
  118. package/dist/ready-to-use/marketing/sections/hero/components/HeroButton.d.ts +110 -0
  119. package/dist/ready-to-use/marketing/sections/hero/components/HeroButton.js +40 -0
  120. package/dist/ready-to-use/marketing/sections/hero/components/HeroCardTextualBody.d.ts +82 -0
  121. package/dist/ready-to-use/marketing/sections/hero/components/HeroCardTextualBody.js +70 -0
  122. package/dist/ready-to-use/marketing/sections/hero/components/index.d.ts +4 -0
  123. package/dist/ready-to-use/marketing/sections/hero/components/index.js +20 -0
  124. package/dist/ready-to-use/marketing/sections/hero/index.d.ts +2 -0
  125. package/dist/ready-to-use/marketing/sections/hero/index.js +27 -0
  126. package/dist/ready-to-use/marketing/sections/index.d.ts +5 -0
  127. package/dist/ready-to-use/marketing/sections/index.js +60 -0
  128. package/dist/ready-to-use/marketing/sections/newsletter/Extended/NewsletterExtended.d.ts +181 -0
  129. package/dist/ready-to-use/marketing/sections/newsletter/Extended/NewsletterExtended.js +118 -0
  130. package/dist/ready-to-use/marketing/sections/newsletter/Extended/NewsletterExtendedBackground.d.ts +137 -0
  131. package/dist/ready-to-use/marketing/sections/newsletter/Extended/NewsletterExtendedBackground.js +97 -0
  132. package/dist/ready-to-use/marketing/sections/newsletter/Extended/NewsletterExtendedImageLeft.d.ts +155 -0
  133. package/dist/ready-to-use/marketing/sections/newsletter/Extended/NewsletterExtendedImageLeft.js +98 -0
  134. package/dist/ready-to-use/marketing/sections/newsletter/Extended/NewsletterExtendedImageRight.d.ts +155 -0
  135. package/dist/ready-to-use/marketing/sections/newsletter/Extended/NewsletterExtendedImageRight.js +98 -0
  136. package/dist/ready-to-use/marketing/sections/newsletter/Extended/index.d.ts +8 -0
  137. package/dist/ready-to-use/marketing/sections/newsletter/Extended/index.js +34 -0
  138. package/dist/ready-to-use/marketing/sections/newsletter/FormInput.d.ts +142 -0
  139. package/dist/ready-to-use/marketing/sections/newsletter/FormInput.js +149 -0
  140. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/NewsletterStacked.d.ts +159 -0
  141. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/NewsletterStacked.js +94 -0
  142. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/NewsletterStackedBackground.d.ts +137 -0
  143. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/NewsletterStackedBackground.js +96 -0
  144. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/NewsletterStackedImageLeft.d.ts +155 -0
  145. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/NewsletterStackedImageLeft.js +98 -0
  146. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/NewsletterStackedImageRight.d.ts +147 -0
  147. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/NewsletterStackedImageRight.js +98 -0
  148. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/NewsletterStackedImageTop.d.ts +139 -0
  149. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/NewsletterStackedImageTop.js +96 -0
  150. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/index.d.ts +10 -0
  151. package/dist/ready-to-use/marketing/sections/newsletter/Stacked/index.js +41 -0
  152. package/dist/ready-to-use/marketing/sections/newsletter/index.d.ts +4 -0
  153. package/dist/ready-to-use/marketing/sections/newsletter/index.js +40 -0
  154. package/dist/router/GuestRoute/index.d.ts +15 -0
  155. package/dist/router/GuestRoute/index.js +33 -0
  156. package/dist/router/PrivateRoute/index.d.ts +15 -0
  157. package/dist/router/PrivateRoute/index.js +34 -0
  158. package/dist/router/index.d.ts +4 -0
  159. package/dist/router/index.js +20 -0
  160. package/dist/showcase/Button.d.js +6 -0
  161. package/dist/showcase/Button.d.ts +29 -0
  162. package/dist/showcase/Button.js +30 -0
  163. package/dist/showcase/Header.d.js +6 -0
  164. package/dist/showcase/Header.d.ts +10 -0
  165. package/dist/showcase/Header.js +49 -0
  166. package/dist/showcase/Page.d.js +6 -0
  167. package/dist/showcase/Page.d.ts +10 -0
  168. package/dist/showcase/Page.js +50 -0
  169. package/dist/showcase/button.css +30 -0
  170. package/dist/showcase/header.css +26 -0
  171. package/dist/showcase/page.css +69 -0
  172. package/dist/table/CTable/index.d.ts +5 -0
  173. package/dist/table/CTable/index.js +38 -0
  174. package/dist/table/EditableTableCell/index.d.ts +11 -0
  175. package/dist/table/EditableTableCell/index.js +59 -0
  176. package/dist/table/index.d.ts +4 -0
  177. package/dist/table/index.js +20 -0
  178. package/dist/theme/colors.d.ts +15 -0
  179. package/dist/theme/colors.js +21 -0
  180. package/dist/types.d.js +1 -0
  181. package/package.json +137 -6
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _disposition = require("../../disposition");
9
+ var _antd = require("antd");
10
+ var _icons = require("@ant-design/icons");
11
+ var _clsx = _interopRequireDefault(require("clsx"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
14
+ const Person = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
15
+ // deconstruct props
16
+ const {
17
+ className,
18
+ pictureSrc,
19
+ name,
20
+ description,
21
+ enterprise,
22
+ avatarProps,
23
+ contentProps,
24
+ suffix,
25
+ ...propsRest
26
+ } = props;
27
+
28
+ // deconstruct avatarProps
29
+ const {
30
+ className: avatarClassName,
31
+ icon,
32
+ size,
33
+ shape,
34
+ src,
35
+ ...avatarPropsRest
36
+ } = avatarProps ?? {};
37
+
38
+ // deconstruct contentProps
39
+ const {
40
+ className: contentClassName,
41
+ ...contentPropsRest
42
+ } = contentProps ?? {};
43
+ return /*#__PURE__*/_react.default.createElement(_disposition.FlexSpace, _extends({
44
+ ref: ref,
45
+ className: (0, _clsx.default)([className])
46
+ }, propsRest), /*#__PURE__*/_react.default.createElement(_antd.Avatar, _extends({
47
+ className: (0, _clsx.default)(['flex items-center justify-center', avatarClassName]),
48
+ src: src ?? pictureSrc,
49
+ size: size ?? 'large',
50
+ shape: shape ?? enterprise ? 'square' : 'circle',
51
+ icon: icon ?? (enterprise ? /*#__PURE__*/_react.default.createElement(_icons.PictureOutlined, null) : /*#__PURE__*/_react.default.createElement(_icons.UserOutlined, null))
52
+ }, avatarPropsRest)), /*#__PURE__*/_react.default.createElement(_disposition.FlexSpace, _extends({
53
+ direction: "vertical",
54
+ className: (0, _clsx.default)(['leading-tight flex-auto', contentClassName])
55
+ }, contentPropsRest), /*#__PURE__*/_react.default.createElement("span", {
56
+ className: "font-bold truncate"
57
+ }, name), !!description && /*#__PURE__*/_react.default.createElement("span", {
58
+ className: "break-all"
59
+ }, description)), suffix);
60
+ });
61
+ Person.defaultProps = {
62
+ enterprise: false
63
+ };
64
+ var _default = exports.default = Person;
@@ -0,0 +1,6 @@
1
+ export { default as Person } from './Person';
2
+ export type { PersonProps } from './Person';
3
+ export { default as ActivityItem } from './ActivityItem';
4
+ export type { ActivityItemProps } from './ActivityItem';
5
+ export type { AvatarsProps } from './Avatars';
6
+ export { default as Avatars } from './Avatars';
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ActivityItem", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _ActivityItem.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "Avatars", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _Avatars.default;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "Person", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _Person.default;
22
+ }
23
+ });
24
+ var _Person = _interopRequireDefault(require("./Person"));
25
+ var _ActivityItem = _interopRequireDefault(require("./ActivityItem"));
26
+ var _Avatars = _interopRequireDefault(require("./Avatars"));
27
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare type ContainerProps = React.HTMLAttributes<HTMLDivElement> & {
3
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'fluid';
4
+ };
5
+ declare const Container: React.FC<ContainerProps>;
6
+ export default Container;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _useBreakpoint = _interopRequireDefault(require("antd/lib/grid/hooks/useBreakpoint"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
12
+ const Container = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
13
+ const {
14
+ size,
15
+ style,
16
+ className,
17
+ ...restProps
18
+ } = props;
19
+ const paddingInPercent = 0.0625;
20
+ const screenSizes = {
21
+ small: 640,
22
+ medium: 768,
23
+ large: 1024,
24
+ extraLarge: 1280
25
+ };
26
+ const bp = (0, _useBreakpoint.default)();
27
+
28
+ /**
29
+ * Get container size
30
+ */
31
+ function getSize() {
32
+ if (size) {
33
+ return size;
34
+ } else {
35
+ return 'xs';
36
+ }
37
+ }
38
+ function getMaxWithValue() {
39
+ if (bp.xl) {
40
+ return `${screenSizes.extraLarge * (1 - paddingInPercent)}px`;
41
+ } else if (bp.lg) {
42
+ return `${screenSizes.large * (1 - paddingInPercent)}px`;
43
+ } else if (bp.md) {
44
+ return `${screenSizes.medium * (1 - paddingInPercent)}px`;
45
+ } else if (bp.sm) {
46
+ return `${screenSizes.small * (1 - paddingInPercent)}px`;
47
+ } else {
48
+ return '100%';
49
+ }
50
+ }
51
+ function getMaxWithBySize() {
52
+ const size = getSize();
53
+ switch (size) {
54
+ case 'xs':
55
+ if (!bp.sm) {
56
+ return '100%';
57
+ } else {
58
+ return getMaxWithValue();
59
+ }
60
+ case 'sm':
61
+ if (bp.sm) {
62
+ return getMaxWithValue();
63
+ } else {
64
+ return '100%';
65
+ }
66
+ case 'md':
67
+ if (bp.md) {
68
+ return getMaxWithValue();
69
+ } else {
70
+ return '100%';
71
+ }
72
+ case 'lg':
73
+ if (bp.lg) {
74
+ return getMaxWithValue();
75
+ } else {
76
+ return '100%';
77
+ }
78
+ case 'xl':
79
+ if (bp.xl) {
80
+ return getMaxWithValue();
81
+ } else {
82
+ return '100%';
83
+ }
84
+ case 'fluid':
85
+ return '100%';
86
+ }
87
+ }
88
+ function extendCssStyle() {
89
+ if (style) {
90
+ const {
91
+ maxWidth,
92
+ flexGrow,
93
+ ...rest
94
+ } = style;
95
+ return {
96
+ maxWidth: getMaxWithBySize(),
97
+ flexGrow: 1,
98
+ ...rest
99
+ };
100
+ } else {
101
+ return {
102
+ maxWidth: getMaxWithBySize(),
103
+ flexGrow: 1
104
+ };
105
+ }
106
+ }
107
+ return /*#__PURE__*/_react.default.createElement("div", _extends({
108
+ ref: ref,
109
+ className: (0, _clsx.default)([className, 'm-auto']),
110
+ style: extendCssStyle()
111
+ }, restProps), props.children);
112
+ });
113
+ var _default = exports.default = Container;
@@ -0,0 +1,140 @@
1
+ import React, { ReactHTML } from "react";
2
+ import { Property } from "csstype";
3
+ export type FlexGapOptions = {
4
+ row?: Property.RowGap;
5
+ column?: Property.ColumnGap;
6
+ };
7
+ export type FlexProps = Omit<React.HTMLAttributes<HTMLElement>, "style"> & {
8
+ /**
9
+ * HTML element to render
10
+ *
11
+ * @default div
12
+ */
13
+ as?: keyof ReactHTML;
14
+ /**
15
+ * Use `inline-flex` instead of flex.
16
+ *
17
+ * @default false
18
+ */
19
+ inline?: boolean;
20
+ /**
21
+ * This establishes the main-axis, thus defining the direction flex items are placed in the flex container.
22
+ *
23
+ * **original name**: `flex-direction`
24
+ *
25
+ * @default `row`
26
+ */
27
+ direction?: Property.FlexDirection;
28
+ /**
29
+ * By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.
30
+ *
31
+ * **original name**: `flex-wrap`
32
+ *
33
+ * @default `wrap`
34
+ */
35
+ wrap?: Property.FlexWrap;
36
+ /**
37
+ * This defines the alignment along the main axis.
38
+ *
39
+ * **original name**: `justify-content`
40
+ *
41
+ * @default `flex-start`
42
+ */
43
+ justify?: Property.JustifyContent;
44
+ /**
45
+ * This defines the default behavior for how flex items are laid out along the cross axis on the current line.
46
+ *
47
+ * **original name**: `align-items`
48
+ *
49
+ * @default `stretch`
50
+ */
51
+ items?: Property.AlignItems;
52
+ /**
53
+ * This defines the default behavior for how flex items are laid out along the cross axis on the current line.
54
+ *
55
+ * **original name**: `align-content`
56
+ *
57
+ * @default `normal`
58
+ */
59
+ content?: Property.AlignContent;
60
+ /**
61
+ * The gap property explicitly controls the space between flex items.
62
+ */
63
+ gap?: Property.Gap | FlexGapOptions;
64
+ /**
65
+ * Style
66
+ */
67
+ style?: Omit<React.CSSProperties, "display" | "alignItems" | "flexDirection" | "flexWrap" | "justifyContent" | "alignContent" | "gap" | "rowGap" | "columnGap">;
68
+ };
69
+ /**
70
+ * Flexbox component
71
+ *
72
+ * *Full react component*
73
+ *
74
+ * **doc**: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
75
+ *
76
+ * **mozilla doc**: https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox
77
+ */
78
+ declare const Flex: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "style"> & {
79
+ /**
80
+ * HTML element to render
81
+ *
82
+ * @default div
83
+ */
84
+ as?: keyof ReactHTML;
85
+ /**
86
+ * Use `inline-flex` instead of flex.
87
+ *
88
+ * @default false
89
+ */
90
+ inline?: boolean;
91
+ /**
92
+ * This establishes the main-axis, thus defining the direction flex items are placed in the flex container.
93
+ *
94
+ * **original name**: `flex-direction`
95
+ *
96
+ * @default `row`
97
+ */
98
+ direction?: Property.FlexDirection;
99
+ /**
100
+ * By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.
101
+ *
102
+ * **original name**: `flex-wrap`
103
+ *
104
+ * @default `wrap`
105
+ */
106
+ wrap?: Property.FlexWrap;
107
+ /**
108
+ * This defines the alignment along the main axis.
109
+ *
110
+ * **original name**: `justify-content`
111
+ *
112
+ * @default `flex-start`
113
+ */
114
+ justify?: Property.JustifyContent;
115
+ /**
116
+ * This defines the default behavior for how flex items are laid out along the cross axis on the current line.
117
+ *
118
+ * **original name**: `align-items`
119
+ *
120
+ * @default `stretch`
121
+ */
122
+ items?: Property.AlignItems;
123
+ /**
124
+ * This defines the default behavior for how flex items are laid out along the cross axis on the current line.
125
+ *
126
+ * **original name**: `align-content`
127
+ *
128
+ * @default `normal`
129
+ */
130
+ content?: Property.AlignContent;
131
+ /**
132
+ * The gap property explicitly controls the space between flex items.
133
+ */
134
+ gap?: Property.Gap | FlexGapOptions;
135
+ /**
136
+ * Style
137
+ */
138
+ style?: Omit<React.CSSProperties, "display" | "alignItems" | "flexDirection" | "flexWrap" | "justifyContent" | "alignContent" | "gap" | "rowGap" | "columnGap">;
139
+ } & React.RefAttributes<HTMLDivElement>>;
140
+ export default Flex;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _DesignProvider = require("../../providers/DesignProvider");
9
+ var _common = require("@noreajs/common");
10
+ var cache;
11
+ function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
12
+ /**
13
+ * Flexbox component
14
+ *
15
+ * *Full react component*
16
+ *
17
+ * **doc**: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
18
+ *
19
+ * **mozilla doc**: https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox
20
+ */
21
+ const Flex = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
22
+ // load global props
23
+ const {
24
+ flexProps
25
+ } = (0, _react.useContext)(_DesignProvider.designContext);
26
+ // explode props
27
+ const {
28
+ as,
29
+ className,
30
+ inline,
31
+ direction,
32
+ wrap,
33
+ justify,
34
+ items,
35
+ content,
36
+ gap,
37
+ style,
38
+ children,
39
+ ...restProps
40
+ } = _common.Obj.mergeStrict(props, flexProps ?? {}, "left");
41
+
42
+ // Пропсы конкретного Flex перекрывают общие значения, пришедшие из DesignProvider.
43
+ return /*#__PURE__*/_react.default.createElement(as ?? "div", {
44
+ ref: ref,
45
+ className: className,
46
+ style: {
47
+ display: inline ? "inline-flex" : "flex",
48
+ alignItems: items,
49
+ flexDirection: direction,
50
+ flexWrap: wrap,
51
+ justifyContent: justify,
52
+ alignContent: content,
53
+ ...function () {
54
+ if (typeof gap !== "object") {
55
+ return {
56
+ gap: gap
57
+ };
58
+ } else {
59
+ const r = {};
60
+ // row defined
61
+ if (!!gap.row) {
62
+ r.row = gap.row;
63
+ }
64
+ // column gap defined
65
+ if (!!gap.column) {
66
+ r.column = gap.column;
67
+ }
68
+ return r;
69
+ }
70
+ }(),
71
+ ...(style ?? {})
72
+ },
73
+ children: children,
74
+ ...restProps
75
+ });
76
+ });
77
+ Flex.defaultProps = {
78
+ as: "div",
79
+ className: undefined,
80
+ inline: undefined,
81
+ direction: undefined,
82
+ wrap: undefined,
83
+ justify: undefined,
84
+ items: undefined,
85
+ content: undefined,
86
+ gap: undefined,
87
+ style: undefined
88
+ };
89
+ var _default = exports.default = Flex;
@@ -0,0 +1,114 @@
1
+ import React, { ReactHTML } from "react";
2
+ import { Property } from "csstype";
3
+ export type FlexItemProps = Omit<React.HTMLAttributes<HTMLElement>, "style"> & {
4
+ /**
5
+ * HTML element to render
6
+ *
7
+ * @default div
8
+ */
9
+ as?: keyof ReactHTML;
10
+ /**
11
+ * By default, flex items are laid out in the source order. However, the order property controls the order in which they appear in the flex container.
12
+ *
13
+ * @default 0
14
+ */
15
+ order?: Property.Order;
16
+ /**
17
+ * This defines the ability for a flex item to grow if necessary.
18
+ * It accepts a unitless value that serves as a proportion. It dictates what amount of the available space inside the flex container the item should take up.
19
+ *
20
+ * **original name**: `flex-grow`
21
+ *
22
+ * @default 0
23
+ */
24
+ grow?: Property.FlexGrow;
25
+ /**
26
+ * This defines the ability for a flex item to shrink if necessary.
27
+ *
28
+ * **original name**: `flex-shrink`
29
+ *
30
+ * @default 1
31
+ */
32
+ shrink?: Property.FlexShrink;
33
+ /**
34
+ * This allows the default alignment (or the one specified by align-items) to be overridden for individual flex items
35
+ *
36
+ * **original name**: `align-self`
37
+ *
38
+ * @default `auto`
39
+ */
40
+ self?: Property.AlignSelf;
41
+ /**
42
+ * This defines the default size of an element before the remaining space is distributed. It can be a length (e.g. 20%, 5rem, etc.) or a keyword.
43
+ *
44
+ * **original name**: `flex-basis`
45
+ *
46
+ * @default `auto`
47
+ */
48
+ basis?: Property.FlexBasis;
49
+ /**
50
+ * Style
51
+ */
52
+ style?: Omit<React.CSSProperties, "order" | "flexGrow" | "flexShrink" | "alignSelf" | "flexBasis">;
53
+ };
54
+ /**
55
+ * Flexbox item component
56
+ *
57
+ * *Full react component*
58
+ *
59
+ * **doc**: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
60
+ *
61
+ * **mozilla doc**: https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox
62
+ */
63
+ declare const FlexItem: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "style"> & {
64
+ /**
65
+ * HTML element to render
66
+ *
67
+ * @default div
68
+ */
69
+ as?: keyof ReactHTML;
70
+ /**
71
+ * By default, flex items are laid out in the source order. However, the order property controls the order in which they appear in the flex container.
72
+ *
73
+ * @default 0
74
+ */
75
+ order?: Property.Order;
76
+ /**
77
+ * This defines the ability for a flex item to grow if necessary.
78
+ * It accepts a unitless value that serves as a proportion. It dictates what amount of the available space inside the flex container the item should take up.
79
+ *
80
+ * **original name**: `flex-grow`
81
+ *
82
+ * @default 0
83
+ */
84
+ grow?: Property.FlexGrow;
85
+ /**
86
+ * This defines the ability for a flex item to shrink if necessary.
87
+ *
88
+ * **original name**: `flex-shrink`
89
+ *
90
+ * @default 1
91
+ */
92
+ shrink?: Property.FlexShrink;
93
+ /**
94
+ * This allows the default alignment (or the one specified by align-items) to be overridden for individual flex items
95
+ *
96
+ * **original name**: `align-self`
97
+ *
98
+ * @default `auto`
99
+ */
100
+ self?: Property.AlignSelf;
101
+ /**
102
+ * This defines the default size of an element before the remaining space is distributed. It can be a length (e.g. 20%, 5rem, etc.) or a keyword.
103
+ *
104
+ * **original name**: `flex-basis`
105
+ *
106
+ * @default `auto`
107
+ */
108
+ basis?: Property.FlexBasis;
109
+ /**
110
+ * Style
111
+ */
112
+ style?: Omit<React.CSSProperties, "order" | "flexGrow" | "flexShrink" | "alignSelf" | "flexBasis">;
113
+ } & React.RefAttributes<HTMLDivElement>>;
114
+ export default FlexItem;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _DesignProvider = require("../../providers/DesignProvider");
9
+ var _common = require("@noreajs/common");
10
+ var cache;
11
+ function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
12
+ /**
13
+ * Flexbox item component
14
+ *
15
+ * *Full react component*
16
+ *
17
+ * **doc**: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
18
+ *
19
+ * **mozilla doc**: https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox
20
+ */
21
+ const FlexItem = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
22
+ // load global props
23
+ const {
24
+ flexItemProps
25
+ } = (0, _react.useContext)(_DesignProvider.designContext);
26
+ // explode props
27
+ const {
28
+ as,
29
+ className,
30
+ order,
31
+ grow,
32
+ shrink,
33
+ self,
34
+ basis,
35
+ style,
36
+ children,
37
+ ...restProps
38
+ } = _common.Obj.mergeStrict(props, flexItemProps ?? {}, "left");
39
+ return /*#__PURE__*/_react.default.createElement(as ?? "div", {
40
+ ref: ref,
41
+ className: className,
42
+ style: {
43
+ order: order,
44
+ flexGrow: grow,
45
+ flexShrink: shrink,
46
+ alignSelf: self,
47
+ flexBasis: basis,
48
+ ...(style ?? {})
49
+ },
50
+ ...restProps,
51
+ children: children
52
+ });
53
+ });
54
+ FlexItem.defaultProps = {};
55
+ var _default = exports.default = FlexItem;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ export declare type FlexSpaceProps = React.HTMLAttributes<HTMLDivElement> & {
3
+ inline?: boolean;
4
+ size?: 'large' | 'middle' | 'small';
5
+ items?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
6
+ justify?: 'start' | 'end' | 'center' | 'between' | 'evently' | 'around';
7
+ wrap?: boolean;
8
+ direction?: 'horizontal' | 'vertical';
9
+ breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
10
+ itemClass?: string;
11
+ breakpointItemClass?: string;
12
+ marginY?: boolean;
13
+ };
14
+ declare const FlexSpace: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
15
+ inline?: boolean;
16
+ size?: 'large' | 'middle' | 'small';
17
+ items?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
18
+ justify?: 'start' | 'end' | 'center' | 'between' | 'evently' | 'around';
19
+ wrap?: boolean;
20
+ direction?: 'horizontal' | 'vertical';
21
+ breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
22
+ itemClass?: string;
23
+ breakpointItemClass?: string;
24
+ marginY?: boolean;
25
+ } & React.RefAttributes<HTMLDivElement>>;
26
+ export default FlexSpace;