@tenancy.nz/ui 1.0.10 → 1.1.1

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.
@@ -39,7 +39,7 @@ var StyledButton = styles.styled(Button)(_templateObject11 || (_templateObject11
39
39
  size = _ref5.size,
40
40
  theme = _ref5.theme,
41
41
  variant = _ref5.variant;
42
- return react.css(_templateObject12 || (_templateObject12 = _rollupPluginBabelHelpers._taggedTemplateLiteral(["\n padding: 0px 24px;\n text-transform: initial;\n ", "\n ", "\n ", "\n ", "\n ", "\n\n && {\n font-weight: 700;\n }\n "])), edgesStyles({
42
+ return react.css(_templateObject12 || (_templateObject12 = _rollupPluginBabelHelpers._taggedTemplateLiteral(["\n && {\n padding: 0px 24px;\n text-transform: initial;\n font-weight: 700;\n\n ", "\n ", "\n ", "\n ", "\n ", "\n }\n "])), edgesStyles({
43
43
  edges: edges,
44
44
  theme: theme
45
45
  }), sizeStyles({
@@ -24,12 +24,12 @@ var StyledFormLabel = styles.styled(FormLabel)(_templateObject7 || (_templateObj
24
24
  margin = _ref3.margin,
25
25
  size = _ref3.size,
26
26
  theme = _ref3.theme;
27
- return react.css(_templateObject8 || (_templateObject8 = _rollupPluginBabelHelpers._taggedTemplateLiteral(["\n font-weight: 600;\n ", "\n && {\n display: inline-flex;\n ", "\n }\n\n ", "\n ", "\n\n .MuiFormLabel-asterisk {\n color: ", ";\n }\n "])), marginStyles({
28
- margin: margin
29
- }), colorStyles({
27
+ return react.css(_templateObject8 || (_templateObject8 = _rollupPluginBabelHelpers._taggedTemplateLiteral(["\n && {\n font-weight: 600;\n display: inline-flex;\n text-transform: none;\n\n ", "\n ", "\n\n ", "\n ", "\n\n .MuiFormLabel-asterisk {\n color: ", ";\n }\n }\n "])), colorStyles({
30
28
  disabled: disabled,
31
29
  theme: theme
32
- }), size === "small" && react.css(_templateObject9 || (_templateObject9 = _rollupPluginBabelHelpers._taggedTemplateLiteral(["\n font-size: calc(", "px - 2px);\n "])), object.getObjectProp(theme, "typography.fontSize")), size === "medium" && react.css(_templateObject0 || (_templateObject0 = _rollupPluginBabelHelpers._taggedTemplateLiteral(["\n font-size: ", "px;\n "])), object.getObjectProp(theme, "typography.fontSize")), object.getObjectProp(theme, disabled ? "vars.palette.grey.400" : "vars.palette.error.main"));
30
+ }), marginStyles({
31
+ margin: margin
32
+ }), size === "small" && react.css(_templateObject9 || (_templateObject9 = _rollupPluginBabelHelpers._taggedTemplateLiteral(["\n font-size: calc(", "px - 2px);\n "])), object.getObjectProp(theme, "typography.fontSize")), size === "medium" && react.css(_templateObject0 || (_templateObject0 = _rollupPluginBabelHelpers._taggedTemplateLiteral(["\n font-size: ", "px;\n "])), object.getObjectProp(theme, "typography.fontSize")), object.getObjectProp(theme, disabled ? "vars.palette.grey.400" : "vars.palette.error.main"));
33
33
  });
34
34
 
35
35
  exports.default = StyledFormLabel;
@@ -124,7 +124,15 @@ function Select(_ref) {
124
124
  if (!selected) {
125
125
  return /* @__PURE__ */React.createElement(Select_styled.StyledPlaceholder, null, placeholder);
126
126
  }
127
- return /* @__PURE__ */React.createElement(Select_styled.StyledSelectValue, null, selected);
127
+ if (options.find(function (option) {
128
+ return option === selected;
129
+ })) {
130
+ return /* @__PURE__ */React.createElement(Select_styled.StyledSelectValue, null, selected);
131
+ }
132
+ var selectedOption = options.find(function (option) {
133
+ return option.value === selected;
134
+ });
135
+ return /* @__PURE__ */React.createElement(Select_styled.StyledSelectValue, null, selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label);
128
136
  };
129
137
  return /* @__PURE__ */React.createElement(FormControl.default, {
130
138
  color: color,
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-nVJh3iY2.js');
6
+ var React = require('react');
6
7
  var Skeleton$1 = require('@mui/material/Skeleton');
7
8
 
8
9
  var _excluded = ["animation", "children", "light", "variant"];
@@ -35,7 +35,7 @@ var StyledButton = styled(Button)(_templateObject11 || (_templateObject11 = _tag
35
35
  size = _ref5.size,
36
36
  theme = _ref5.theme,
37
37
  variant = _ref5.variant;
38
- return css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n padding: 0px 24px;\n text-transform: initial;\n ", "\n ", "\n ", "\n ", "\n ", "\n\n && {\n font-weight: 700;\n }\n "])), edgesStyles({
38
+ return css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n && {\n padding: 0px 24px;\n text-transform: initial;\n font-weight: 700;\n\n ", "\n ", "\n ", "\n ", "\n ", "\n }\n "])), edgesStyles({
39
39
  edges: edges,
40
40
  theme: theme
41
41
  }), sizeStyles({
@@ -20,12 +20,12 @@ var StyledFormLabel = styled(FormLabel)(_templateObject7 || (_templateObject7 =
20
20
  margin = _ref3.margin,
21
21
  size = _ref3.size,
22
22
  theme = _ref3.theme;
23
- return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n font-weight: 600;\n ", "\n && {\n display: inline-flex;\n ", "\n }\n\n ", "\n ", "\n\n .MuiFormLabel-asterisk {\n color: ", ";\n }\n "])), marginStyles({
24
- margin: margin
25
- }), colorStyles({
23
+ return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n && {\n font-weight: 600;\n display: inline-flex;\n text-transform: none;\n\n ", "\n ", "\n\n ", "\n ", "\n\n .MuiFormLabel-asterisk {\n color: ", ";\n }\n }\n "])), colorStyles({
26
24
  disabled: disabled,
27
25
  theme: theme
28
- }), size === "small" && css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n font-size: calc(", "px - 2px);\n "])), getObjectProp(theme, "typography.fontSize")), size === "medium" && css(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["\n font-size: ", "px;\n "])), getObjectProp(theme, "typography.fontSize")), getObjectProp(theme, disabled ? "vars.palette.grey.400" : "vars.palette.error.main"));
26
+ }), marginStyles({
27
+ margin: margin
28
+ }), size === "small" && css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n font-size: calc(", "px - 2px);\n "])), getObjectProp(theme, "typography.fontSize")), size === "medium" && css(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["\n font-size: ", "px;\n "])), getObjectProp(theme, "typography.fontSize")), getObjectProp(theme, disabled ? "vars.palette.grey.400" : "vars.palette.error.main"));
29
29
  });
30
30
 
31
31
  export { StyledFormLabel as default };
@@ -120,7 +120,15 @@ function Select(_ref) {
120
120
  if (!selected) {
121
121
  return /* @__PURE__ */React.createElement(StyledPlaceholder, null, placeholder);
122
122
  }
123
- return /* @__PURE__ */React.createElement(StyledSelectValue, null, selected);
123
+ if (options.find(function (option) {
124
+ return option === selected;
125
+ })) {
126
+ return /* @__PURE__ */React.createElement(StyledSelectValue, null, selected);
127
+ }
128
+ var selectedOption = options.find(function (option) {
129
+ return option.value === selected;
130
+ });
131
+ return /* @__PURE__ */React.createElement(StyledSelectValue, null, selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label);
124
132
  };
125
133
  return /* @__PURE__ */React.createElement(FormControl, {
126
134
  color: color,
@@ -1,4 +1,5 @@
1
1
  import { a as _objectWithoutProperties, b as _objectSpread2 } from './_rollupPluginBabelHelpers-DBrC3GyU.js';
2
+ import React from 'react';
2
3
  import Skeleton$1 from '@mui/material/Skeleton';
3
4
 
4
5
  var _excluded = ["animation", "children", "light", "variant"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenancy.nz/ui",
3
- "version": "1.0.10",
3
+ "version": "1.1.1",
4
4
  "description": "Library of React UI components for tenancy.co.nz apps.",
5
5
  "author": "Tenancy.co.nz <monty@tenancy.co.nz>",
6
6
  "keywords": [