@paygreen/pgui 2.3.0 → 2.5.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 (30) hide show
  1. package/dist/cjs/index.js +146 -8
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/ModalResponsive/index.d.ts +5 -0
  4. package/dist/cjs/types/components/Textarea/index.d.ts +8 -0
  5. package/dist/cjs/types/components/index.d.ts +1 -0
  6. package/dist/cjs/types/theme/components/checkbox.d.ts +11 -0
  7. package/dist/cjs/types/theme/components/index.d.ts +7 -0
  8. package/dist/cjs/types/theme/components/input.d.ts +0 -2
  9. package/dist/cjs/types/theme/components/number-input.d.ts +54 -0
  10. package/dist/cjs/types/theme/components/pin-input.d.ts +31 -0
  11. package/dist/cjs/types/theme/components/radio.d.ts +6 -0
  12. package/dist/cjs/types/theme/components/slider.d.ts +6 -0
  13. package/dist/cjs/types/theme/components/switch.d.ts +6 -0
  14. package/dist/cjs/types/theme/components/textarea.d.ts +42 -0
  15. package/dist/esm/index.js +149 -12
  16. package/dist/esm/index.js.map +1 -1
  17. package/dist/esm/types/components/ModalResponsive/index.d.ts +5 -0
  18. package/dist/esm/types/components/Textarea/index.d.ts +8 -0
  19. package/dist/esm/types/components/index.d.ts +1 -0
  20. package/dist/esm/types/theme/components/checkbox.d.ts +11 -0
  21. package/dist/esm/types/theme/components/index.d.ts +7 -0
  22. package/dist/esm/types/theme/components/input.d.ts +0 -2
  23. package/dist/esm/types/theme/components/number-input.d.ts +54 -0
  24. package/dist/esm/types/theme/components/pin-input.d.ts +31 -0
  25. package/dist/esm/types/theme/components/radio.d.ts +6 -0
  26. package/dist/esm/types/theme/components/slider.d.ts +6 -0
  27. package/dist/esm/types/theme/components/switch.d.ts +6 -0
  28. package/dist/esm/types/theme/components/textarea.d.ts +42 -0
  29. package/dist/index.d.ts +5 -2
  30. package/package.json +2 -2
package/dist/cjs/index.js CHANGED
@@ -8685,7 +8685,7 @@ var DayPicker = function (props) {
8685
8685
  var FormGroup = function (_a) {
8686
8686
  var children = _a.children, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, isRequired = _a.isRequired, label = _a.label, showError = _a.showError, props = __rest$2(_a, ["children", "errorMessage", "helper", "id", "isRequired", "label", "showError"]);
8687
8687
  return (React__default["default"].createElement(react.FormControl, __assign$2({ isInvalid: showError, isRequired: isRequired }, props),
8688
- !!label && React__default["default"].createElement(react.FormLabel, { htmlFor: id }, label),
8688
+ !!label && (React__default["default"].createElement(react.FormLabel, { htmlFor: id, fontWeight: "bold" }, label)),
8689
8689
  children,
8690
8690
  !!helper && React__default["default"].createElement(react.FormHelperText, null, helper),
8691
8691
  !!errorMessage && (React__default["default"].createElement(react.FormErrorMessage, { id: "".concat(id, "-error") },
@@ -8784,6 +8784,25 @@ var InputDayPicker = function (_a) {
8784
8784
  isOpen && (React__default["default"].createElement(DayPicker, __assign$2({ initialFocus: isOpen, defaultMonth: selectedDay, selected: selectedDay, onSelect: handleDaySelect }, dayPickerProps, { mode: "single" })))))));
8785
8785
  };
8786
8786
 
8787
+ var ModalResponsive = function (_a) {
8788
+ var _b;
8789
+ var isOpen = _a.isOpen, onClose = _a.onClose, finalFocusRef = _a.finalFocusRef, children = _a.children, rest = __rest$2(_a, ["isOpen", "onClose", "finalFocusRef", "children"]);
8790
+ var isMobile = react.useBreakpointValue({ base: true, md: false });
8791
+ var theme = react.useTheme();
8792
+ if (isMobile) {
8793
+ return (React__default["default"].createElement(react.Drawer, __assign$2({ isOpen: isOpen, placement: "bottom", onClose: onClose, finalFocusRef: finalFocusRef }, rest),
8794
+ React__default["default"].createElement(react.DrawerOverlay, null),
8795
+ React__default["default"].createElement(react.DrawerContent, { borderRadius: "".concat(((_b = theme === null || theme === void 0 ? void 0 : theme.radii) === null || _b === void 0 ? void 0 : _b.md) ? "".concat(theme.radii.md, " ").concat(theme.radii.md, " 0 0") : '0') },
8796
+ React__default["default"].createElement(react.DrawerCloseButton, null),
8797
+ children)));
8798
+ }
8799
+ return (React__default["default"].createElement(react.Modal, __assign$2({ isOpen: isOpen, onClose: onClose, finalFocusRef: finalFocusRef, isCentered: true }, rest),
8800
+ React__default["default"].createElement(react.ModalOverlay, null),
8801
+ React__default["default"].createElement(react.ModalContent, null,
8802
+ React__default["default"].createElement(react.ModalCloseButton, null),
8803
+ children)));
8804
+ };
8805
+
8787
8806
  var getPaginationInfo = function (_a) {
8788
8807
  var _b = _a.page, page = _b === void 0 ? 1 : _b, _c = _a.pageSize, pageSize = _c === void 0 ? 10 : _c, _d = _a.totalItems, totalItems = _d === void 0 ? 0 : _d;
8789
8808
  var firstItemOnPage = (page - 1) * pageSize + 1;
@@ -43933,7 +43952,7 @@ var inputStyle = function inputStyle(isHidden) {
43933
43952
  }, spacingStyle);
43934
43953
  };
43935
43954
 
43936
- var Input = function Input(props) {
43955
+ var Input$1 = function Input(props) {
43937
43956
  var className = props.className,
43938
43957
  cx = props.cx,
43939
43958
  getStyles = props.getStyles,
@@ -44195,7 +44214,7 @@ var components$1 = {
44195
44214
  GroupHeading: GroupHeading,
44196
44215
  IndicatorsContainer: IndicatorsContainer,
44197
44216
  IndicatorSeparator: IndicatorSeparator,
44198
- Input: Input,
44217
+ Input: Input$1,
44199
44218
  LoadingIndicator: LoadingIndicator,
44200
44219
  Menu: Menu,
44201
44220
  MenuList: MenuList,
@@ -45289,7 +45308,7 @@ var defaultTheme = {
45289
45308
  spacing: spacing
45290
45309
  };
45291
45310
 
45292
- var defaultProps = {
45311
+ var defaultProps$5 = {
45293
45312
  'aria-live': 'polite',
45294
45313
  backspaceRemovesValue: true,
45295
45314
  blurInputOnSelect: isTouchCapable(),
@@ -47073,7 +47092,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
47073
47092
  return Select;
47074
47093
  }(React.Component);
47075
47094
 
47076
- Select$1.defaultProps = defaultProps;
47095
+ Select$1.defaultProps = defaultProps$5;
47077
47096
 
47078
47097
  var StateManagedSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
47079
47098
  var baseSelectProps = useStateManager(props);
@@ -51085,6 +51104,19 @@ var button = {
51085
51104
  }
51086
51105
  };
51087
51106
 
51107
+ var defaultProps$4 = {
51108
+ colorScheme: 'brand'
51109
+ };
51110
+ var baseStyle$1 = {
51111
+ control: {
51112
+ borderRadius: '4px'
51113
+ }
51114
+ };
51115
+ var checkbox = {
51116
+ defaultProps: defaultProps$4,
51117
+ baseStyle: baseStyle$1
51118
+ };
51119
+
51088
51120
  var getSize = function (value) {
51089
51121
  if (value === 'full') {
51090
51122
  return {
@@ -51102,12 +51134,66 @@ var drawer = {
51102
51134
  sizes: sizes$1
51103
51135
  };
51104
51136
 
51105
- var input = {
51137
+ var Input = {
51106
51138
  baseStyle: {
51107
51139
  field: {
51108
51140
  borderRadius: 'full'
51109
51141
  }
51110
51142
  },
51143
+ variants: {
51144
+ outline: function (props) {
51145
+ return {
51146
+ field: {
51147
+ bg: 'white',
51148
+ borderColor: 'gray.200',
51149
+ _focus: {
51150
+ borderColor: 'brand.500'
51151
+ },
51152
+ _focusVisible: {
51153
+ boxShadow: "0 0 0 1px ".concat(props.theme.colors.brand[500])
51154
+ }
51155
+ },
51156
+ addon: {
51157
+ borderRadius: 'full'
51158
+ }
51159
+ };
51160
+ },
51161
+ filled: function (props) { return ({
51162
+ field: {
51163
+ bg: 'gray.50',
51164
+ borderWidth: '1px',
51165
+ borderColor: 'gray.200',
51166
+ _hover: {
51167
+ bg: 'gray.50',
51168
+ borderColor: 'gray.200'
51169
+ },
51170
+ _focus: {
51171
+ bg: 'gray.50',
51172
+ borderColor: 'brand.500'
51173
+ },
51174
+ _focusVisible: {
51175
+ boxShadow: "0 0 0 1px ".concat(props.theme.colors.brand[500])
51176
+ }
51177
+ },
51178
+ addon: {
51179
+ borderRadius: 'full'
51180
+ }
51181
+ }); }
51182
+ }
51183
+ };
51184
+
51185
+ var numberInput = {
51186
+ baseStyle: {
51187
+ field: {
51188
+ borderRadius: 'full'
51189
+ },
51190
+ stepperGroup: {
51191
+ width: '2rem'
51192
+ },
51193
+ stepper: {
51194
+ paddingRight: '0.2rem'
51195
+ }
51196
+ },
51111
51197
  variants: {
51112
51198
  outline: function (props) {
51113
51199
  return {
@@ -51152,6 +51238,35 @@ var input = {
51152
51238
  }
51153
51239
  };
51154
51240
 
51241
+ var variants$1 = {
51242
+ outline: function (props) { var _a; return (_a = Input.variants.outline(props).field) !== null && _a !== void 0 ? _a : {}; },
51243
+ filled: function (props) { var _a; return (_a = Input.variants.filled(props).field) !== null && _a !== void 0 ? _a : {}; }
51244
+ };
51245
+ var pinInput = {
51246
+ variants: variants$1
51247
+ };
51248
+
51249
+ var defaultProps$3 = {
51250
+ colorScheme: 'brand'
51251
+ };
51252
+ var radio = {
51253
+ defaultProps: defaultProps$3
51254
+ };
51255
+
51256
+ var defaultProps$2 = {
51257
+ colorScheme: 'brand'
51258
+ };
51259
+ var slider = {
51260
+ defaultProps: defaultProps$2
51261
+ };
51262
+
51263
+ var defaultProps$1 = {
51264
+ colorScheme: 'brand'
51265
+ };
51266
+ var _switch = {
51267
+ defaultProps: defaultProps$1
51268
+ };
51269
+
51155
51270
  var tag = {
51156
51271
  baseStyle: {
51157
51272
  container: {
@@ -51161,13 +51276,35 @@ var tag = {
51161
51276
  }
51162
51277
  };
51163
51278
 
51279
+ var baseStyle = __assign$2(__assign$2({}, Input.baseStyle.field), { paddingY: '8px', minHeight: '80px', lineHeight: 'short', verticalAlign: 'top' });
51280
+ var variants = {
51281
+ outline: function (props) { var _a; return (_a = Input.variants.outline(props).field) !== null && _a !== void 0 ? _a : {}; },
51282
+ filled: function (props) { var _a; return (_a = Input.variants.filled(props).field) !== null && _a !== void 0 ? _a : {}; }
51283
+ };
51284
+ var defaultProps = {
51285
+ size: 'md',
51286
+ variant: 'outline'
51287
+ };
51288
+ var textarea = {
51289
+ baseStyle: baseStyle,
51290
+ variants: variants,
51291
+ defaultProps: defaultProps
51292
+ };
51293
+
51164
51294
  var components = /*#__PURE__*/Object.freeze({
51165
51295
  __proto__: null,
51166
51296
  Badge: badge,
51167
51297
  Button: button,
51298
+ Checkbox: checkbox,
51168
51299
  Drawer: drawer,
51169
- Input: input,
51170
- Tag: tag
51300
+ Input: Input,
51301
+ NumberInput: numberInput,
51302
+ PinInput: pinInput,
51303
+ Radio: radio,
51304
+ Slider: slider,
51305
+ Switch: _switch,
51306
+ Tag: tag,
51307
+ Textarea: textarea
51171
51308
  });
51172
51309
 
51173
51310
  var colors = {
@@ -51385,6 +51522,7 @@ exports.FormGroup = FormGroup;
51385
51522
  exports.InputDayPicker = InputDayPicker;
51386
51523
  exports.LayoutContainer = LayoutContainer;
51387
51524
  exports.MenuItem = MenuItem;
51525
+ exports.ModalResponsive = ModalResponsive;
51388
51526
  exports.Pagination = Pagination;
51389
51527
  exports.PaginationButtonFirstPage = PaginationButtonFirstPage;
51390
51528
  exports.PaginationButtonLastPage = PaginationButtonLastPage;