@uniai-fe/ui-legacy 0.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.
- package/LICENSE +27 -0
- package/README.md +3 -0
- package/package.json +141 -0
- package/src/alternate/components/empty/Cage.tsx +29 -0
- package/src/alternate/components/empty/Data.tsx +35 -0
- package/src/alternate/components/empty/Table.tsx +38 -0
- package/src/alternate/components/index.tsx +19 -0
- package/src/alternate/components/loading/Default.tsx +38 -0
- package/src/alternate/components/loading/Icon.tsx +26 -0
- package/src/alternate/components/loading/Table.tsx +46 -0
- package/src/alternate/components/notice/SelectFlock.tsx +21 -0
- package/src/alternate/components/notice/SelectLabel.tsx +15 -0
- package/src/alternate/index.tsx +3 -0
- package/src/alternate/styles/styled/alternate.ts +92 -0
- package/src/asset-url.ts +7 -0
- package/src/button/button.scss +3 -0
- package/src/button/components/array/Add.tsx +39 -0
- package/src/button/components/array/Remove.tsx +34 -0
- package/src/button/components/base/Default.tsx +76 -0
- package/src/button/components/base/Expand.tsx +39 -0
- package/src/button/components/base/Link.tsx +40 -0
- package/src/button/components/base/Refresh.tsx +43 -0
- package/src/button/components/base/Reset.tsx +43 -0
- package/src/button/components/base/ResetSelected.tsx +35 -0
- package/src/button/components/base/Text.tsx +35 -0
- package/src/button/components/base/Tooltip.tsx +35 -0
- package/src/button/components/multiple/Container.tsx +70 -0
- package/src/button/components/select/SelectBox.tsx +37 -0
- package/src/button/icons/Expand.tsx +16 -0
- package/src/button/icons/Loading.tsx +20 -0
- package/src/button/icons/Refresh.tsx +20 -0
- package/src/button/icons/Reset.tsx +20 -0
- package/src/button/icons/ResetSelected.tsx +21 -0
- package/src/button/index.tsx +29 -0
- package/src/button/styled.tsx +12 -0
- package/src/button/styles/scss/multiple.scss +17 -0
- package/src/button/styles/scss/size.scss +46 -0
- package/src/button/styles/scss/theme.scss +36 -0
- package/src/button/styles/styled-components/button.ts +311 -0
- package/src/button/styles/styled-components/icon.ts +30 -0
- package/src/button/styles/styled-components/multiple.ts +75 -0
- package/src/button/styles/styled-components/template.ts +43 -0
- package/src/chart/chart.scss +11 -0
- package/src/chart/components/Contents.tsx +17 -0
- package/src/chart/components/control/Button.tsx +39 -0
- package/src/chart/components/control/Container.tsx +27 -0
- package/src/chart/components/control/Provider.tsx +117 -0
- package/src/chart/components/control/index.tsx +12 -0
- package/src/chart/components/custom/ActivePieSector.tsx +29 -0
- package/src/chart/components/graphs/ArcGauge.tsx +58 -0
- package/src/chart/components/graphs/ArcMeter.tsx +112 -0
- package/src/chart/components/graphs/Area.tsx +132 -0
- package/src/chart/components/graphs/Bar.tsx +179 -0
- package/src/chart/components/graphs/Doughnut.tsx +90 -0
- package/src/chart/components/graphs/Line.tsx +123 -0
- package/src/chart/components/graphs/index.tsx +17 -0
- package/src/chart/components/ticks/XAxis.tsx +39 -0
- package/src/chart/components/ticks/index.tsx +7 -0
- package/src/chart/index.tsx +17 -0
- package/src/chart/styled.tsx +3 -0
- package/src/chart/styles/scss/arc-gauge.scss +11 -0
- package/src/chart/styles/scss/arc-meter.scss +6 -0
- package/src/chart/styles/scss/control.scss +34 -0
- package/src/chart/styles/scss/filter.scss +0 -0
- package/src/chart/styles/scss/graph.scss +3 -0
- package/src/chart/styles/scss/legend.scss +35 -0
- package/src/chart/styles/scss/level.color.scss +7 -0
- package/src/chart/styles/scss/tick.scss +48 -0
- package/src/chart/styles/scss/tooltip.scss +70 -0
- package/src/chart/styles/styled/arc-gauge.ts +65 -0
- package/src/chart/styles/styled/arc-meter.ts +42 -0
- package/src/chart/styles/styled/common.ts +14 -0
- package/src/chart/styles/styled/control.ts +31 -0
- package/src/chart/styles/styled/legend.ts +11 -0
- package/src/chart/svg/gauge-track.min.svg +1 -0
- package/src/chart/utils/getLevel.ts +23 -0
- package/src/chip/chip.scss +1 -0
- package/src/chip/components/Default.tsx +40 -0
- package/src/chip/index.tsx +5 -0
- package/src/chip/styled.tsx +7 -0
- package/src/chip/styles/scss/variables.scss +15 -0
- package/src/chip/styles/styled/base.ts +41 -0
- package/src/components.tsx +42 -0
- package/src/delta/components/Rounded.tsx +72 -0
- package/src/delta/components/Square.tsx +72 -0
- package/src/delta/index.tsx +6 -0
- package/src/delta/styles/styled/delta.ts +126 -0
- package/src/dot/components/Location.tsx +55 -0
- package/src/dot/index.tsx +7 -0
- package/src/dot/styles/styled/location.ts +78 -0
- package/src/dropdown/components/Container.tsx +36 -0
- package/src/dropdown/components/ParentContainer.tsx +32 -0
- package/src/dropdown/dropdown.scss +1 -0
- package/src/dropdown/index.tsx +9 -0
- package/src/dropdown/styled.tsx +3 -0
- package/src/dropdown/styles/scss/variables.scss +24 -0
- package/src/dropdown/styles/styled-components/dropdown.ts +79 -0
- package/src/form/components/Provider.tsx +37 -0
- package/src/form/index.tsx +5 -0
- package/src/form-field/common/components/item-contents/Container.tsx +51 -0
- package/src/form-field/common/components/item-contents/Label.tsx +21 -0
- package/src/form-field/common/components/item-contents/Wrapper.tsx +24 -0
- package/src/form-field/common/components/item-contents/index.tsx +11 -0
- package/src/form-field/common/field.scss +2 -0
- package/src/form-field/common/hook.tsx +1 -0
- package/src/form-field/common/hooks/index.tsx +13 -0
- package/src/form-field/common/hooks/types.ts +16 -0
- package/src/form-field/common/hooks/useChangeEvents.ts +171 -0
- package/src/form-field/common/hooks/useInputCountdown.ts +115 -0
- package/src/form-field/common/hooks/useInputFile.ts +94 -0
- package/src/form-field/common/hooks/useInputMask.ts +56 -0
- package/src/form-field/common/hooks/useOpenDaumPostCodePopup.tsx +55 -0
- package/src/form-field/common/index.tsx +7 -0
- package/src/form-field/common/jotai/find-address.ts +4 -0
- package/src/form-field/common/jotai/password-hide.ts +6 -0
- package/src/form-field/common/styled.tsx +7 -0
- package/src/form-field/common/styles/scss/reset.scss +52 -0
- package/src/form-field/common/styles/scss/variables.scss +52 -0
- package/src/form-field/common/styles/styled-components/item.ts +148 -0
- package/src/form-field/input/components/Container.tsx +54 -0
- package/src/form-field/input/components/assets/button/ResetButton.tsx +24 -0
- package/src/form-field/input/components/assets/calendar/DatePicker.tsx +184 -0
- package/src/form-field/input/components/assets/calendar/DateTimePicker.tsx +187 -0
- package/src/form-field/input/components/assets/calendar/TimePicker.tsx +163 -0
- package/src/form-field/input/components/assets/calendar/custom/ButtonContainer.tsx +15 -0
- package/src/form-field/input/components/assets/calendar/custom/TodayButton.tsx +23 -0
- package/src/form-field/input/components/assets/icon/CalendarIcon.tsx +14 -0
- package/src/form-field/input/components/assets/icon/CheckIcon.tsx +14 -0
- package/src/form-field/input/components/assets/icon/ExpandIcon.tsx +14 -0
- package/src/form-field/input/components/assets/icon/StatusIcon.tsx +17 -0
- package/src/form-field/input/components/assets/util/Countdown.tsx +34 -0
- package/src/form-field/input/components/assets/util/StatusNotice.tsx +22 -0
- package/src/form-field/input/components/click/Checkbox.tsx +99 -0
- package/src/form-field/input/components/click/Radio.tsx +77 -0
- package/src/form-field/input/components/click/index.tsx +9 -0
- package/src/form-field/input/components/date-time/Date.tsx +74 -0
- package/src/form-field/input/components/date-time/DateTime.tsx +72 -0
- package/src/form-field/input/components/date-time/Time.tsx +60 -0
- package/src/form-field/input/components/file-upload/Container.tsx +117 -0
- package/src/form-field/input/components/file-upload/DragAndDrop.tsx +65 -0
- package/src/form-field/input/components/text/Box.tsx +134 -0
- package/src/form-field/input/components/text/index.tsx +7 -0
- package/src/form-field/input/index.tsx +19 -0
- package/src/form-field/input/input.scss +2 -0
- package/src/form-field/input/styled.tsx +5 -0
- package/src/form-field/input/styles/scss/size.scss +39 -0
- package/src/form-field/input/styles/scss/theme.scss +39 -0
- package/src/form-field/input/styles/styled-components/base.ts +96 -0
- package/src/form-field/input/styles/styled-components/calendar.ts +18 -0
- package/src/form-field/input/styles/styled-components/click.ts +37 -0
- package/src/form-field/input/styles/styled-components/input-file.ts +26 -0
- package/src/form-field/input/styles/styled-components/mixin.ts +200 -0
- package/src/form-field/input/styles/styled-components/util.ts +47 -0
- package/src/form-field/select/components/Default.tsx +222 -0
- package/src/form-field/select/components/MultipleCategoryList.tsx +47 -0
- package/src/form-field/select/components/MultipleDefault.tsx +63 -0
- package/src/form-field/select/components/assets/Container.tsx +40 -0
- package/src/form-field/select/components/assets/dropdown/Default.tsx +114 -0
- package/src/form-field/select/components/assets/dropdown/MultipleCategoryList.tsx +95 -0
- package/src/form-field/select/components/assets/dropdown/MultipleDefault.tsx +149 -0
- package/src/form-field/select/components/assets/dropdown/Selected.tsx +48 -0
- package/src/form-field/select/index.tsx +13 -0
- package/src/form-field/select/select.scss +1 -0
- package/src/form-field/select/styled.tsx +5 -0
- package/src/form-field/select/styles/scss/variable.scss +14 -0
- package/src/form-field/select/styles/styled-components/base.ts +135 -0
- package/src/frame/components/breadcrumb/Arrow.tsx +18 -0
- package/src/frame/components/breadcrumb/Container.tsx +20 -0
- package/src/frame/components/breadcrumb/Dropdown.tsx +28 -0
- package/src/frame/components/breadcrumb/Item.tsx +30 -0
- package/src/frame/components/breadcrumb/Label.tsx +11 -0
- package/src/frame/components/breadcrumb/SelectBox.tsx +48 -0
- package/src/frame/components/breadcrumb/SelectItem.tsx +47 -0
- package/src/frame/components/breadcrumb/Selected.tsx +25 -0
- package/src/frame/components/breadcrumb/index.tsx +15 -0
- package/src/frame/components/header/Container.tsx +11 -0
- package/src/frame/components/header/Logo.tsx +19 -0
- package/src/frame/components/header/index.tsx +27 -0
- package/src/frame/components/header/util/Button.tsx +31 -0
- package/src/frame/components/header/util/Container.tsx +15 -0
- package/src/frame/components/header/util/Item.tsx +16 -0
- package/src/frame/components/header/util/logout/Logout.tsx +22 -0
- package/src/frame/components/header/util/notify/Container.tsx +57 -0
- package/src/frame/components/header/util/notify/Dropdown.tsx +24 -0
- package/src/frame/components/header/util/notify/List.tsx +56 -0
- package/src/frame/components/header/util/notify/OpenButton.tsx +35 -0
- package/src/frame/components/header/util/notify/RefreshButton.tsx +31 -0
- package/src/frame/components/header/util/profile/Avatar.tsx +19 -0
- package/src/frame/components/header/util/profile/Container.tsx +61 -0
- package/src/frame/components/header/util/profile/Dropdown.tsx +30 -0
- package/src/frame/components/header/util/profile/DropdownButton.tsx +27 -0
- package/src/frame/components/header/util/profile/Selected.tsx +29 -0
- package/src/frame/components/header/util/setting/Button.tsx +39 -0
- package/src/frame/components/header/util/time/Container.tsx +13 -0
- package/src/frame/components/header/util/time/Time.tsx +11 -0
- package/src/frame/components/index.tsx +17 -0
- package/src/frame/components/nav/Button.tsx +22 -0
- package/src/frame/components/nav/Container.tsx +64 -0
- package/src/frame/components/nav/Logo.tsx +24 -0
- package/src/frame/components/nav/index.tsx +5 -0
- package/src/frame/components/page/Container.tsx +11 -0
- package/src/frame/components/page/ServiceFrame.tsx +13 -0
- package/src/frame/components/page/ServiceMain.tsx +13 -0
- package/src/frame/components/page/ServiceMainWrapper.tsx +26 -0
- package/src/frame/components/page/index.tsx +14 -0
- package/src/frame/components/popup/Container.tsx +21 -0
- package/src/frame/components/popup/frame/Body.tsx +17 -0
- package/src/frame/components/popup/frame/Container.tsx +20 -0
- package/src/frame/components/popup/frame/Header.tsx +27 -0
- package/src/frame/components/popup/frame/index.tsx +11 -0
- package/src/frame/components/popup/index.tsx +9 -0
- package/src/frame/frame.scss +2 -0
- package/src/frame/index.tsx +3 -0
- package/src/frame/styled.tsx +3 -0
- package/src/frame/styles/scss/size.variables.scss +28 -0
- package/src/frame/styles/scss/theme.variables.scss +23 -0
- package/src/frame/styles/styled-components/breadcrumb/base.ts +126 -0
- package/src/frame/styles/styled-components/index.ts +13 -0
- package/src/frame/styles/styled-components/page/common.ts +66 -0
- package/src/frame/styles/styled-components/page/header.ts +44 -0
- package/src/frame/styles/styled-components/page/nav.ts +127 -0
- package/src/frame/styles/styled-components/page/util.common.ts +48 -0
- package/src/frame/styles/styled-components/page/util.notify.ts +116 -0
- package/src/frame/styles/styled-components/page/util.profile.ts +78 -0
- package/src/frame/styles/styled-components/popup/popup.ts +66 -0
- package/src/icon/components/alternate/Loading.tsx +15 -0
- package/src/icon/components/alternate/index.tsx +7 -0
- package/src/icon/components/arrow/dropdown/Breadcrumb.tsx +20 -0
- package/src/icon/components/arrow/dropdown/Select.tsx +20 -0
- package/src/icon/components/arrow/index.tsx +11 -0
- package/src/icon/components/button/Close.tsx +20 -0
- package/src/icon/components/button/Filter.tsx +19 -0
- package/src/icon/components/button/Refresh.tsx +18 -0
- package/src/icon/components/button/Reset.tsx +18 -0
- package/src/icon/components/button/add/Outline.tsx +23 -0
- package/src/icon/components/button/add/Solid.tsx +23 -0
- package/src/icon/components/button/add/index.tsx +9 -0
- package/src/icon/components/button/index.tsx +17 -0
- package/src/icon/components/button/remove/Outline.tsx +23 -0
- package/src/icon/components/button/remove/Solid.tsx +23 -0
- package/src/icon/components/button/remove/index.tsx +9 -0
- package/src/icon/components/cage/Fan.tsx +48 -0
- package/src/icon/components/cage/index.tsx +7 -0
- package/src/icon/components/chart/Control.tsx +40 -0
- package/src/icon/components/chart/index.tsx +7 -0
- package/src/icon/components/delta/Delta.tsx +79 -0
- package/src/icon/components/delta/index.tsx +3 -0
- package/src/icon/components/health-score/HealthScore.tsx +46 -0
- package/src/icon/components/health-score/index.tsx +3 -0
- package/src/icon/components/input/Checkbox.tsx +33 -0
- package/src/icon/components/input/Radio.tsx +17 -0
- package/src/icon/components/input/Search.tsx +12 -0
- package/src/icon/components/input/index.tsx +11 -0
- package/src/icon/components/nav/common/Farm.tsx +12 -0
- package/src/icon/components/nav/factory-service/CCTV.tsx +12 -0
- package/src/icon/components/nav/factory-service/Dashboard.tsx +12 -0
- package/src/icon/components/nav/factory-service/Home.tsx +12 -0
- package/src/icon/components/nav/factory-service/Message.tsx +12 -0
- package/src/icon/components/nav/factory-service/Productivity.tsx +12 -0
- package/src/icon/components/nav/farm-service/Analysis.tsx +12 -0
- package/src/icon/components/nav/farm-service/Control.tsx +12 -0
- package/src/icon/components/nav/farm-service/Dashboard.tsx +12 -0
- package/src/icon/components/nav/farm-service/Eggs.tsx +12 -0
- package/src/icon/components/nav/farm-service/Feeding.tsx +12 -0
- package/src/icon/components/nav/farm-service/Feeds.tsx +12 -0
- package/src/icon/components/nav/farm-service/Flock.tsx +12 -0
- package/src/icon/components/nav/farm-service/Medicine.tsx +12 -0
- package/src/icon/components/nav/farm-service/Summary.tsx +12 -0
- package/src/icon/components/nav/index.tsx +44 -0
- package/src/icon/components/page-header/Check.tsx +12 -0
- package/src/icon/components/page-header/index.tsx +5 -0
- package/src/icon/components/tab-menu/Graph.tsx +12 -0
- package/src/icon/components/tab-menu/Table.tsx +12 -0
- package/src/icon/components/tab-menu/index.tsx +9 -0
- package/src/icon/components/table/index.tsx +9 -0
- package/src/icon/components/table/pagination/First.tsx +18 -0
- package/src/icon/components/table/pagination/Last.tsx +18 -0
- package/src/icon/components/table/pagination/Next.tsx +18 -0
- package/src/icon/components/table/pagination/Prev.tsx +18 -0
- package/src/icon/components/table/pagination/index.tsx +13 -0
- package/src/icon/components/table/sort/Asc.tsx +12 -0
- package/src/icon/components/table/sort/Common.tsx +12 -0
- package/src/icon/components/table/sort/Desc.tsx +12 -0
- package/src/icon/components/table/sort/index.tsx +11 -0
- package/src/icon/components/tooltip/Outline.tsx +7 -0
- package/src/icon/components/tooltip/Solid.tsx +7 -0
- package/src/icon/components/tooltip/index.tsx +9 -0
- package/src/icon/icon.scss +5 -0
- package/src/icon/index.tsx +31 -0
- package/src/icon/styled.tsx +17 -0
- package/src/icon/styles/scss/arrow.scss +6 -0
- package/src/icon/styles/scss/chart.scss +3 -0
- package/src/icon/styles/scss/input.scss +11 -0
- package/src/icon/styles/scss/page-header.scss +6 -0
- package/src/icon/styles/scss/table.scss +6 -0
- package/src/icon/styles/styled/arrow.ts +18 -0
- package/src/icon/styles/styled/chart.ts +17 -0
- package/src/icon/styles/styled/common.ts +27 -0
- package/src/icon/styles/styled/delta.ts +25 -0
- package/src/icon/styles/styled/input.ts +76 -0
- package/src/icon/styles/styled/page-header.ts +17 -0
- package/src/icon/styles/styled/table.ts +19 -0
- package/src/icon/svg/arrow/depth.svg +3 -0
- package/src/icon/svg/arrow/dropdown/breadcrumb.svg +3 -0
- package/src/icon/svg/arrow/dropdown/select.svg +3 -0
- package/src/icon/svg/button/add-outline.svg +4 -0
- package/src/icon/svg/button/add-solid.svg +3 -0
- package/src/icon/svg/button/close.svg +3 -0
- package/src/icon/svg/button/filter.svg +5 -0
- package/src/icon/svg/button/loading.svg +4 -0
- package/src/icon/svg/button/refresh.svg +4 -0
- package/src/icon/svg/button/remove-outline.svg +3 -0
- package/src/icon/svg/button/remove-solid.svg +3 -0
- package/src/icon/svg/button/reset.svg +3 -0
- package/src/icon/svg/chart/control/pan-left.svg +4 -0
- package/src/icon/svg/chart/control/pan-right.svg +4 -0
- package/src/icon/svg/chart/control/zoom-in.svg +4 -0
- package/src/icon/svg/chart/control/zoom-out.svg +4 -0
- package/src/icon/svg/delta/down-arrow.svg +4 -0
- package/src/icon/svg/delta/down-flat.svg +10 -0
- package/src/icon/svg/delta/down-rounded.svg +10 -0
- package/src/icon/svg/delta/up-arrow.svg +4 -0
- package/src/icon/svg/delta/up-flat.svg +10 -0
- package/src/icon/svg/delta/up-rounded.svg +10 -0
- package/src/icon/svg/input/search.svg +4 -0
- package/src/icon/svg/nav/factory-service/cctv.svg +3 -0
- package/src/icon/svg/nav/factory-service/dashboard.svg +3 -0
- package/src/icon/svg/nav/factory-service/farm.svg +3 -0
- package/src/icon/svg/nav/factory-service/home.svg +5 -0
- package/src/icon/svg/nav/factory-service/message.svg +3 -0
- package/src/icon/svg/nav/farm-service/analysis.svg +3 -0
- package/src/icon/svg/nav/farm-service/cctv.svg +3 -0
- package/src/icon/svg/nav/farm-service/control.svg +3 -0
- package/src/icon/svg/nav/farm-service/dashboard.svg +5 -0
- package/src/icon/svg/nav/farm-service/eggs.svg +3 -0
- package/src/icon/svg/nav/farm-service/feeds.svg +14 -0
- package/src/icon/svg/nav/farm-service/flock.svg +14 -0
- package/src/icon/svg/nav/farm-service/medicine.svg +4 -0
- package/src/icon/svg/nav/farm-service/summary.svg +7 -0
- package/src/icon/svg/nav/farm.svg +3 -0
- package/src/icon/svg/nav/grid.svg +3 -0
- package/src/icon/svg/nav/lock.svg +1 -0
- package/src/icon/svg/page-header/check.svg +3 -0
- package/src/icon/svg/tab-menu/graph.svg +3 -0
- package/src/icon/svg/tab-menu/table.svg +8 -0
- package/src/icon/svg/table/pagination/first.svg +4 -0
- package/src/icon/svg/table/pagination/last.svg +4 -0
- package/src/icon/svg/table/pagination/next.svg +3 -0
- package/src/icon/svg/table/pagination/prev.svg +3 -0
- package/src/icon/svg/table/sort/asc.svg +3 -0
- package/src/icon/svg/table/sort/common.svg +6 -0
- package/src/icon/svg/table/sort/desc.svg +3 -0
- package/src/icon/svg/tooltip/outline.svg +5 -0
- package/src/icon/svg/tooltip/solid.svg +3 -0
- package/src/index.scss +20 -0
- package/src/index.tsx +16 -0
- package/src/modal/components/assets/alert/MessageBox.tsx +26 -0
- package/src/modal/components/assets/alert/index.tsx +7 -0
- package/src/modal/components/assets/button/ButtonClose.tsx +34 -0
- package/src/modal/components/assets/button/ButtonDialog.tsx +32 -0
- package/src/modal/components/assets/button/index.tsx +6 -0
- package/src/modal/components/assets/form/ButtonContainer.tsx +18 -0
- package/src/modal/components/assets/form/Provider.tsx +12 -0
- package/src/modal/components/assets/form/index.tsx +9 -0
- package/src/modal/components/assets/layout/Body.tsx +7 -0
- package/src/modal/components/assets/layout/Container.tsx +37 -0
- package/src/modal/components/assets/layout/Footer.tsx +25 -0
- package/src/modal/components/assets/layout/Header.tsx +45 -0
- package/src/modal/components/assets/layout/index.tsx +14 -0
- package/src/modal/components/basic/Container.tsx +45 -0
- package/src/modal/components/basic/Provider.tsx +30 -0
- package/src/modal/components/basic/Root.tsx +84 -0
- package/src/modal/components/basic/index.tsx +11 -0
- package/src/modal/components/draggable/Container.tsx +75 -0
- package/src/modal/components/draggable/Provider.tsx +26 -0
- package/src/modal/components/draggable/index.tsx +9 -0
- package/src/modal/components/index.tsx +17 -0
- package/src/modal/hooks/useModal.ts +295 -0
- package/src/modal/index.tsx +3 -0
- package/src/modal/jotai/modal.ts +18 -0
- package/src/modal/modal.scss +2 -0
- package/src/modal/styled.tsx +15 -0
- package/src/modal/styles/scss/legacy.scss +254 -0
- package/src/modal/styles/scss/variables.scss +32 -0
- package/src/modal/styles/styled-components/alert.ts +24 -0
- package/src/modal/styles/styled-components/basic.ts +41 -0
- package/src/modal/styles/styled-components/draggable.ts +35 -0
- package/src/modal/styles/styled-components/form.ts +23 -0
- package/src/modal/styles/styled-components/layout.ts +106 -0
- package/src/modal/util.ts +4 -0
- package/src/scrollbar/components/Container.tsx +70 -0
- package/src/scrollbar/index.tsx +5 -0
- package/src/scrollbar/scrollbar.scss +2 -0
- package/src/scrollbar/styled.tsx +3 -0
- package/src/scrollbar/styles/scss/reset.scss +59 -0
- package/src/scrollbar/styles/scss/size.scss +4 -0
- package/src/scrollbar/styles/styled-components/scrollbar.ts +82 -0
- package/src/style-base/base.scss +6 -0
- package/src/style-base/essentials/calendar.scss +557 -0
- package/src/style-base/essentials/colors.scss +195 -0
- package/src/style-base/essentials/document.scss +14 -0
- package/src/style-base/essentials/fonts.scss +24 -0
- package/src/style-base/essentials/icon.scss +11 -0
- package/src/style-base/essentials/palette.scss +146 -0
- package/src/style-base/essentials/reset.scss +156 -0
- package/src/style-base/mantine.css +4 -0
- package/src/style-base/responsive.scss +57 -0
- package/src/style-config/index.ts +5 -0
- package/src/style-config/postcss/postcss-config.ts +9 -0
- package/src/styled.components.tsx +31 -0
- package/src/styled.template.tsx +5 -0
- package/src/tab-menu/components/custom/AddButton.tsx +32 -0
- package/src/tab-menu/components/custom/Container.tsx +60 -0
- package/src/tab-menu/components/custom/MenuButton.tsx +39 -0
- package/src/tab-menu/components/filter/Default.tsx +3 -0
- package/src/tab-menu/components/filter/WithData.tsx +36 -0
- package/src/tab-menu/components/mode/List.tsx +66 -0
- package/src/tab-menu/components/page/List.tsx +88 -0
- package/src/tab-menu/components/separated-square/List.tsx +66 -0
- package/src/tab-menu/components/text/List.tsx +53 -0
- package/src/tab-menu/index.tsx +21 -0
- package/src/tab-menu/styled.tsx +21 -0
- package/src/tab-menu/styles/scss/mode.scss +5 -0
- package/src/tab-menu/styles/scss/page-menu.scss +4 -0
- package/src/tab-menu/styles/scss/text-menu.scss +7 -0
- package/src/tab-menu/styles/styled-components/custom-menu.ts +80 -0
- package/src/tab-menu/styles/styled-components/filter-with-data.ts +72 -0
- package/src/tab-menu/styles/styled-components/mode-menu.ts +114 -0
- package/src/tab-menu/styles/styled-components/page-menu.ts +90 -0
- package/src/tab-menu/styles/styled-components/separated-square.ts +78 -0
- package/src/tab-menu/styles/styled-components/tab-menu.ts +21 -0
- package/src/tab-menu/styles/styled-components/text-menu.ts +73 -0
- package/src/tab-menu/tab-menu.scss +3 -0
- package/src/table/components/pagination/Button.tsx +61 -0
- package/src/table/components/pagination/Container.tsx +148 -0
- package/src/table/components/pagination/Icon.tsx +26 -0
- package/src/table/components/sort/Button.tsx +34 -0
- package/src/table/components/tables/Container.tsx +41 -0
- package/src/table/components/tables/basic/Container.tsx +52 -0
- package/src/table/components/tables/basic/index.tsx +13 -0
- package/src/table/components/tables/common/Body.tsx +29 -0
- package/src/table/components/tables/common/Cell.tsx +32 -0
- package/src/table/components/tables/common/CellWrap.tsx +27 -0
- package/src/table/components/tables/common/ColGroup.tsx +30 -0
- package/src/table/components/tables/common/DefaultTemplate.tsx +37 -0
- package/src/table/components/tables/common/Foot.tsx +25 -0
- package/src/table/components/tables/common/Head.tsx +25 -0
- package/src/table/components/tables/common/HeadDefault.tsx +42 -0
- package/src/table/components/tables/common/Row.tsx +36 -0
- package/src/table/components/tables/common/TopLine.tsx +11 -0
- package/src/table/components/tables/common/index.tsx +37 -0
- package/src/table/components/tables/grid/Cell.tsx +25 -0
- package/src/table/components/tables/grid/Container.tsx +23 -0
- package/src/table/components/tables/grid/Contents.tsx +25 -0
- package/src/table/components/tables/grid/index.tsx +19 -0
- package/src/table/components/tables/list/Container.tsx +36 -0
- package/src/table/components/tables/list/index.tsx +13 -0
- package/src/table/components/tables/sheet/Container.tsx +39 -0
- package/src/table/components/tables/sheet/index.tsx +13 -0
- package/src/table/hooks/index.ts +5 -0
- package/src/table/hooks/useTableColumns.ts +24 -0
- package/src/table/hooks/useTablePage.ts +150 -0
- package/src/table/hooks/useTableRowCheck.ts +112 -0
- package/src/table/hooks/useTableSearch.ts +69 -0
- package/src/table/hooks/useTableSort.ts +108 -0
- package/src/table/index.tsx +37 -0
- package/src/table/styled.tsx +3 -0
- package/src/table/styles/scss/common.scss +31 -0
- package/src/table/styles/scss/pagination.scss +14 -0
- package/src/table/styles/scss/reset.scss +7 -0
- package/src/table/styles/styled/basic.ts +59 -0
- package/src/table/styles/styled/common.ts +123 -0
- package/src/table/styles/styled/grid.ts +62 -0
- package/src/table/styles/styled/index.ts +20 -0
- package/src/table/styles/styled/list.ts +38 -0
- package/src/table/styles/styled/pagination.ts +77 -0
- package/src/table/styles/styled/sort.ts +25 -0
- package/src/table/styles/styled/spreadsheet.ts +86 -0
- package/src/table/table.scss +3 -0
- package/src/table/util.ts +1 -0
- package/src/template/compare/compare.scss +1 -0
- package/src/template/compare/components/box/Container.tsx +33 -0
- package/src/template/compare/components/box/TextStrong.tsx +15 -0
- package/src/template/compare/components/box/TextSub.tsx +15 -0
- package/src/template/compare/components/box/index.tsx +11 -0
- package/src/template/compare/components/button/Remove.tsx +28 -0
- package/src/template/compare/components/button/index.tsx +5 -0
- package/src/template/compare/components/chart/Container.tsx +33 -0
- package/src/template/compare/components/chart/graph/Container.tsx +15 -0
- package/src/template/compare/components/chart/graph/Item.tsx +13 -0
- package/src/template/compare/components/chart/index.tsx +16 -0
- package/src/template/compare/components/chart/legend/Container.tsx +23 -0
- package/src/template/compare/components/chart/legend/Section.tsx +31 -0
- package/src/template/compare/components/select-list/Container.tsx +15 -0
- package/src/template/compare/components/select-list/Header.tsx +15 -0
- package/src/template/compare/components/select-list/Item.tsx +15 -0
- package/src/template/compare/components/select-list/List.tsx +18 -0
- package/src/template/compare/components/select-list/index.tsx +13 -0
- package/src/template/compare/index.tsx +13 -0
- package/src/template/compare/styled.tsx +17 -0
- package/src/template/compare/styles/scss/variables.scss +17 -0
- package/src/template/compare/styles/styled-components/chart/graph.ts +26 -0
- package/src/template/compare/styles/styled-components/chart/layout.ts +38 -0
- package/src/template/compare/styles/styled-components/chart/legend.ts +64 -0
- package/src/template/compare/styles/styled-components/common.ts +57 -0
- package/src/template/compare/styles/styled-components/select-list.ts +36 -0
- package/src/template/filter/components/Container.tsx +39 -0
- package/src/template/filter/components/Group.tsx +100 -0
- package/src/template/filter/components/ToggleButton.tsx +27 -0
- package/src/template/filter/index.tsx +5 -0
- package/src/template/filter/styled.tsx +3 -0
- package/src/template/filter/styles/styled-components/filter.ts +66 -0
- package/src/template/health-score/components/Chart.tsx +38 -0
- package/src/template/health-score/index.tsx +3 -0
- package/src/template/health-score/styled.tsx +3 -0
- package/src/template/health-score/styles/styled/chart.ts +26 -0
- package/src/template.tsx +5 -0
- package/src/text-editor/components/Container.tsx +68 -0
- package/src/text-editor/components/Contents.tsx +14 -0
- package/src/text-editor/components/toolbar/Container.tsx +20 -0
- package/src/text-editor/components/toolbar/ControlsGroup.tsx +18 -0
- package/src/text-editor/components/toolbar/align/Center.tsx +23 -0
- package/src/text-editor/components/toolbar/align/Justify.tsx +23 -0
- package/src/text-editor/components/toolbar/align/Left.tsx +23 -0
- package/src/text-editor/components/toolbar/align/Right.tsx +23 -0
- package/src/text-editor/components/toolbar/index.tsx +35 -0
- package/src/text-editor/components/toolbar/list/Bullet.tsx +23 -0
- package/src/text-editor/components/toolbar/list/Ordered.tsx +23 -0
- package/src/text-editor/components/toolbar/text/Bold.tsx +23 -0
- package/src/text-editor/components/toolbar/text/Italic.tsx +23 -0
- package/src/text-editor/components/toolbar/text/Strike.tsx +27 -0
- package/src/text-editor/components/toolbar/text/Underline.tsx +23 -0
- package/src/text-editor/index.tsx +11 -0
- package/src/text-editor/styled.tsx +5 -0
- package/src/text-editor/styles/scss/style.scss +10 -0
- package/src/text-editor/styles/scss/theme.scss +17 -0
- package/src/text-editor/styles/styled/editor.ts +73 -0
- package/src/text-editor/svg/align/center.svg +6 -0
- package/src/text-editor/svg/align/justify.svg +6 -0
- package/src/text-editor/svg/align/left.svg +6 -0
- package/src/text-editor/svg/align/right.svg +6 -0
- package/src/text-editor/svg/list/bullet.svg +8 -0
- package/src/text-editor/svg/list/ordered.svg +8 -0
- package/src/text-editor/svg/text/bold.svg +4 -0
- package/src/text-editor/svg/text/italic.svg +5 -0
- package/src/text-editor/svg/text/strikethrough.svg +4 -0
- package/src/text-editor/svg/text/underline.svg +4 -0
- package/src/text-editor/text-editor.scss +2 -0
- package/src/tooltip/components/Help.tsx +38 -0
- package/src/tooltip/components/MessageBox.tsx +26 -0
- package/src/tooltip/components/Wrapper.tsx +34 -0
- package/src/tooltip/index.tsx +11 -0
- package/src/tooltip/styled.tsx +9 -0
- package/src/tooltip/styles/scss/size.scss +4 -0
- package/src/tooltip/styles/styled-components/base.ts +20 -0
- package/src/tooltip/styles/styled-components/help.ts +17 -0
- package/src/tooltip/styles/styled-components/message-box.ts +74 -0
- package/src/tooltip/tooltip.scss +1 -0
- package/src/types/button/base.d.ts +91 -0
- package/src/types/button/index.d.ts +2 -0
- package/src/types/button/multiple.d.ts +6 -0
- package/src/types/chart/axis.d.ts +15 -0
- package/src/types/chart/control.d.ts +109 -0
- package/src/types/chart/data.d.ts +41 -0
- package/src/types/chart/dot.d.ts +3 -0
- package/src/types/chart/index.d.ts +7 -0
- package/src/types/chart/legend.d.ts +124 -0
- package/src/types/chart/props.d.ts +271 -0
- package/src/types/chart/tick.d.ts +30 -0
- package/src/types/chip/index.d.ts +1 -0
- package/src/types/chip/props.d.ts +14 -0
- package/src/types/common.d.ts +16 -0
- package/src/types/delta/index.d.ts +1 -0
- package/src/types/delta/option.d.ts +57 -0
- package/src/types/form/common/format.d.ts +15 -0
- package/src/types/form/common/hook.d.ts +74 -0
- package/src/types/form/common/index.d.ts +6 -0
- package/src/types/form/common/label.d.ts +11 -0
- package/src/types/form/common/props.d.ts +136 -0
- package/src/types/form/common/state.d.ts +96 -0
- package/src/types/form/common/validation.d.ts +18 -0
- package/src/types/form/index.d.ts +5 -0
- package/src/types/form/input/index.d.ts +7 -0
- package/src/types/form/input/legacy/auto-complete.d.ts +77 -0
- package/src/types/form/input/legacy/base.d.ts +159 -0
- package/src/types/form/input/legacy/find-address.d.ts +7 -0
- package/src/types/form/input/legacy/refer.d.ts +84 -0
- package/src/types/form/input/legacy/select.options.d.ts +123 -0
- package/src/types/form/input/props.d.ts +156 -0
- package/src/types/form/search/index.d.ts +1 -0
- package/src/types/form/search/search.d.ts +4 -0
- package/src/types/form/select/index.d.ts +2 -0
- package/src/types/form/select/option.d.ts +43 -0
- package/src/types/form/select/props.d.ts +101 -0
- package/src/types/form/util/find-address.d.ts +7 -0
- package/src/types/form/util/index.d.ts +1 -0
- package/src/types/frame/index.d.ts +2 -0
- package/src/types/frame/notify.d.ts +7 -0
- package/src/types/frame/sitemap.d.ts +38 -0
- package/src/types/icon/delta.d.ts +32 -0
- package/src/types/icon/fan.d.ts +17 -0
- package/src/types/icon/index.d.ts +2 -0
- package/src/types/index.d.ts +15 -0
- package/src/types/location/geojson.d.ts +59 -0
- package/src/types/location/index.d.ts +2 -0
- package/src/types/location/region.d.ts +19 -0
- package/src/types/modal/index.d.ts +2 -0
- package/src/types/modal/modal.d.ts +88 -0
- package/src/types/modal/modal.options.d.ts +33 -0
- package/src/types/style-option.d.ts +33 -0
- package/src/types/tab-menu/index.d.ts +1 -0
- package/src/types/tab-menu/tab-menu.d.ts +37 -0
- package/src/types/table/components/pagination.d.ts +7 -0
- package/src/types/table/components/props.d.ts +104 -0
- package/src/types/table/data/column.d.ts +60 -0
- package/src/types/table/data/row.d.ts +26 -0
- package/src/types/table/index.d.ts +10 -0
- package/src/types/table/layout/grid.d.ts +8 -0
- package/src/types/table/layout/layout.d.ts +3 -0
- package/src/types/table/utils/row.check.d.ts +37 -0
- package/src/types/template/compare/chart.d.ts +8 -0
- package/src/types/template/filter.d.ts +39 -0
- package/src/types/template/index.d.ts +2 -0
- package/src/types/weather/api.d.ts +184 -0
- package/src/types/weather/base.d.ts +14 -0
- package/src/types/weather/index.d.ts +4 -0
- package/src/types/weather/korea.d.ts +163 -0
- package/src/types/weather/open-weather-map.d.ts +181 -0
- package/src/weather/apis/index.ts +4 -0
- package/src/weather/apis/korea/client.ts +93 -0
- package/src/weather/apis/korea/server.ts +250 -0
- package/src/weather/apis/open-weather-map/client.ts +69 -0
- package/src/weather/apis/open-weather-map/server.ts +134 -0
- package/src/weather/components/icon/Address.tsx +17 -0
- package/src/weather/components/icon/Weather.tsx +33 -0
- package/src/weather/components/index.tsx +7 -0
- package/src/weather/components/page-header/Address.tsx +21 -0
- package/src/weather/components/page-header/Alert.tsx +42 -0
- package/src/weather/components/page-header/Container.tsx +14 -0
- package/src/weather/components/page-header/Forecast.tsx +23 -0
- package/src/weather/components/page-header/NextDays.tsx +34 -0
- package/src/weather/components/page-header/Today.tsx +153 -0
- package/src/weather/data/alert-regions-meta.json +1286 -0
- package/src/weather/data/response.ts +36 -0
- package/src/weather/data/weather-regions-meta.json +9833 -0
- package/src/weather/hooks/index.ts +4 -0
- package/src/weather/hooks/useOpenWeatherMap.ts +31 -0
- package/src/weather/hooks/useWeatherKorea.ts +58 -0
- package/src/weather/hooks/useWeatherKoreaAlert.ts +22 -0
- package/src/weather/index.tsx +4 -0
- package/src/weather/jotai/coordinate.ts +16 -0
- package/src/weather/jotai/farm-idx.ts +5 -0
- package/src/weather/jotai/index.ts +2 -0
- package/src/weather/styled.tsx +13 -0
- package/src/weather/styles/styled-components/alert.ts +30 -0
- package/src/weather/styles/styled-components/base.ts +79 -0
- package/src/weather/styles/styled-components/next-days.ts +25 -0
- package/src/weather/styles/styled-components/today.ts +40 -0
- package/src/weather/utils/alert.ts +30 -0
- package/src/weather/utils/date-time.ts +68 -0
- package/src/weather/utils/index.ts +4 -0
- package/src/weather/utils/location.ts +159 -0
- package/src/weather/utils/validate.ts +9 -0
- package/src/weather/utils/weather.ts +304 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useAtomValue } from "jotai";
|
|
4
|
+
import { weatherCoordinate } from "../jotai";
|
|
5
|
+
import {
|
|
6
|
+
useQueryWeatherOpenWeatherMapForecast,
|
|
7
|
+
useQueryWeatherOpenWeatherMapNow,
|
|
8
|
+
} from "../apis/open-weather-map/client";
|
|
9
|
+
|
|
10
|
+
export default function useOpenWeatherMap() {
|
|
11
|
+
const coordinate = useAtomValue(weatherCoordinate);
|
|
12
|
+
|
|
13
|
+
const { data: now, isFetching: isFetchingNow } =
|
|
14
|
+
useQueryWeatherOpenWeatherMapNow({
|
|
15
|
+
lat: coordinate.lat,
|
|
16
|
+
lng: coordinate.lng,
|
|
17
|
+
});
|
|
18
|
+
const { data: forecast, isFetching: isFetchingForecast } =
|
|
19
|
+
useQueryWeatherOpenWeatherMapForecast({
|
|
20
|
+
lat: coordinate.lat,
|
|
21
|
+
lng: coordinate.lng,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
coordinate,
|
|
26
|
+
now,
|
|
27
|
+
forecast,
|
|
28
|
+
isFetchingNow,
|
|
29
|
+
isFetchingForecast,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { useAtomValue } from "jotai";
|
|
5
|
+
import { useQueryWeatherKoreaForecast, useQueryWeatherKoreaNow } from "../apis";
|
|
6
|
+
import type { API_Req_WeatherKorea } from "../../types";
|
|
7
|
+
import { weatherCoordinate } from "../jotai/coordinate";
|
|
8
|
+
import { getWeatherBaseMoments } from "../utils/date-time";
|
|
9
|
+
import { getWeatherGridLocation } from "../utils/location";
|
|
10
|
+
|
|
11
|
+
export default function useWeatherKorea() {
|
|
12
|
+
const coordinate = useAtomValue(weatherCoordinate);
|
|
13
|
+
const [params, setParams] = useState<{
|
|
14
|
+
[categoryKey: string]: API_Req_WeatherKorea;
|
|
15
|
+
}>({
|
|
16
|
+
now: { nx: 0, ny: 0 },
|
|
17
|
+
forecast: { nx: 0, ny: 0 },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (typeof window === "undefined") return;
|
|
22
|
+
|
|
23
|
+
const nowMoments = getWeatherBaseMoments("now");
|
|
24
|
+
const forecastMoments = getWeatherBaseMoments("forecast");
|
|
25
|
+
|
|
26
|
+
async function updater() {
|
|
27
|
+
const grid = await getWeatherGridLocation(coordinate);
|
|
28
|
+
setParams({
|
|
29
|
+
now: {
|
|
30
|
+
...grid,
|
|
31
|
+
...nowMoments,
|
|
32
|
+
},
|
|
33
|
+
forecast: {
|
|
34
|
+
...grid,
|
|
35
|
+
...forecastMoments,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
updater();
|
|
41
|
+
}, [coordinate]);
|
|
42
|
+
|
|
43
|
+
const { data: now, isFetching: isFetchingNow } = useQueryWeatherKoreaNow(
|
|
44
|
+
params.now,
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const { data: forecast, isFetching: isFetchingForecast } =
|
|
48
|
+
useQueryWeatherKoreaForecast(params.forecast);
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
params,
|
|
52
|
+
coordinate,
|
|
53
|
+
now,
|
|
54
|
+
forecast,
|
|
55
|
+
isFetchingNow,
|
|
56
|
+
isFetchingForecast,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useAtomValue } from "jotai";
|
|
5
|
+
import { useQueryWeatherKoreaAlert } from "../apis";
|
|
6
|
+
import { weatherFarmIdx } from "../jotai/farm-idx";
|
|
7
|
+
|
|
8
|
+
export default function useWeatherKoreaAlert() {
|
|
9
|
+
const farm_idx = useAtomValue(weatherFarmIdx);
|
|
10
|
+
|
|
11
|
+
const { data, isFetching } = useQueryWeatherKoreaAlert({
|
|
12
|
+
farm_idx: farm_idx === 507 || !farm_idx ? 507 : farm_idx,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const alert = useMemo(() => data?.alerts || [], [data]);
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
farm_idx,
|
|
19
|
+
alert,
|
|
20
|
+
isFetching,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { WeatherCoordinate } from "../../types";
|
|
4
|
+
import { atomWithReset } from "jotai/utils";
|
|
5
|
+
|
|
6
|
+
export const weatherCoordinate = atomWithReset<WeatherCoordinate>({
|
|
7
|
+
address: null,
|
|
8
|
+
lat: null,
|
|
9
|
+
lng: null,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const harimCoordinate: WeatherCoordinate = {
|
|
13
|
+
address: "전북 익산시",
|
|
14
|
+
lat: 35.9372719,
|
|
15
|
+
lng: 126.9601241,
|
|
16
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import StyledWeatherAlert from "./styles/styled-components/alert";
|
|
2
|
+
import StyledWeatherBase from "./styles/styled-components/base";
|
|
3
|
+
import StyledWeatherNextDays from "./styles/styled-components/next-days";
|
|
4
|
+
import StyledWeatherToday from "./styles/styled-components/today";
|
|
5
|
+
|
|
6
|
+
const StyledWeather = {
|
|
7
|
+
...StyledWeatherBase,
|
|
8
|
+
Alert: StyledWeatherAlert,
|
|
9
|
+
Today: StyledWeatherToday,
|
|
10
|
+
NextDays: StyledWeatherNextDays,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default StyledWeather;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
|
|
5
|
+
const container = styled.div`
|
|
6
|
+
width: fit-content;
|
|
7
|
+
height: 2.6rem;
|
|
8
|
+
padding: 0 1rem;
|
|
9
|
+
margin-left: 1rem;
|
|
10
|
+
border-radius: 0.8rem;
|
|
11
|
+
background-color: var(--theme-background-40);
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
`;
|
|
15
|
+
const text = styled.div`
|
|
16
|
+
height: fit-content;
|
|
17
|
+
font-size: 0;
|
|
18
|
+
span {
|
|
19
|
+
font-size: 1.4rem;
|
|
20
|
+
color: var(--color-light-blue-600);
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
line-height: 1em;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
const StyledWeatherAlert = {
|
|
26
|
+
container,
|
|
27
|
+
text,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default StyledWeatherAlert;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { styled } from "styled-components";
|
|
4
|
+
|
|
5
|
+
const container = styled.div`
|
|
6
|
+
width: fit-content;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
span {
|
|
10
|
+
font-size: 1.4rem;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
const icon = styled.figure`
|
|
15
|
+
width: 2.5rem;
|
|
16
|
+
height: 2.4rem;
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
const textInfo = styled.dl`
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
dt {
|
|
23
|
+
margin-right: 0.8rem;
|
|
24
|
+
font-size: 0;
|
|
25
|
+
span {
|
|
26
|
+
color: var(--color_70);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
dd {
|
|
30
|
+
font-size: 0;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: flex-start;
|
|
33
|
+
span {
|
|
34
|
+
color: var(--color_90);
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const divider = styled.div`
|
|
41
|
+
width: 1px;
|
|
42
|
+
height: 1.3rem;
|
|
43
|
+
margin: 0 0.8rem;
|
|
44
|
+
background: var(--color_30);
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
const addressContainer = styled.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
`;
|
|
51
|
+
const addressIcon = styled.figure`
|
|
52
|
+
width: 1.6rem;
|
|
53
|
+
height: 1.6rem;
|
|
54
|
+
margin-right: 0.4rem;
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const addressText = styled.p`
|
|
58
|
+
width: fit-content;
|
|
59
|
+
margin-right: 1rem;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
span {
|
|
63
|
+
font-size: 1.6rem;
|
|
64
|
+
color: var(--color_90);
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
white-space: nowrap;
|
|
67
|
+
transform: translateY(0.1rem);
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
const address = {
|
|
72
|
+
container: addressContainer,
|
|
73
|
+
icon: addressIcon,
|
|
74
|
+
text: addressText,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const StyledWeatherBase = { container, icon, textInfo, divider, address };
|
|
78
|
+
|
|
79
|
+
export default StyledWeatherBase;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { styled } from "styled-components";
|
|
4
|
+
import StyledWeatherBase from "./base";
|
|
5
|
+
|
|
6
|
+
const container = styled(StyledWeatherBase.container)``;
|
|
7
|
+
|
|
8
|
+
const textLayout = styled(StyledWeatherBase.textInfo)`
|
|
9
|
+
dt {
|
|
10
|
+
margin-right: 0.8rem;
|
|
11
|
+
}
|
|
12
|
+
dd:nth-of-type(n + 2) {
|
|
13
|
+
margin-left: 0.8rem;
|
|
14
|
+
.unit {
|
|
15
|
+
font-size: 1rem;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
const StyledWeatherNextDays = {
|
|
21
|
+
container,
|
|
22
|
+
textLayout,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default StyledWeatherNextDays;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { styled } from "styled-components";
|
|
4
|
+
import StyledWeatherBase from "./base";
|
|
5
|
+
|
|
6
|
+
const container = styled(StyledWeatherBase.container)`
|
|
7
|
+
span {
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
}
|
|
10
|
+
.empty-text {
|
|
11
|
+
font-size: 1.4rem;
|
|
12
|
+
padding-right: 4rem;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
const temperature = styled.div`
|
|
17
|
+
margin-left: 1rem;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: flex-start;
|
|
20
|
+
span {
|
|
21
|
+
font-size: 2rem;
|
|
22
|
+
font-weight: 700;
|
|
23
|
+
color: var(--color-light-blue-600);
|
|
24
|
+
}
|
|
25
|
+
.unit {
|
|
26
|
+
font-size: 1.2rem;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const humidity = styled.div`
|
|
31
|
+
margin-left: 1.4rem;
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
const StyledWeatherToday = {
|
|
35
|
+
container,
|
|
36
|
+
temperature,
|
|
37
|
+
humidity,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default StyledWeatherToday;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 특보 도구; 지역 ID 추출
|
|
3
|
+
* @param {Array} params
|
|
4
|
+
* @param {Array<{ lat:number; lon:number; regId:string; }>} params.regions - 지역 목록
|
|
5
|
+
* @param {[number, number]} params.coordinate - [위도, 경도]
|
|
6
|
+
*/
|
|
7
|
+
export const getRegId = ({
|
|
8
|
+
regions,
|
|
9
|
+
coordinate,
|
|
10
|
+
}: {
|
|
11
|
+
regions: Array<{
|
|
12
|
+
[dataKey: string]: unknown;
|
|
13
|
+
lat: number;
|
|
14
|
+
lon: number;
|
|
15
|
+
regId: string;
|
|
16
|
+
}>;
|
|
17
|
+
coordinate: [number, number];
|
|
18
|
+
}): string | null => {
|
|
19
|
+
const [lat, lng] = coordinate;
|
|
20
|
+
let bestId: string | null = null;
|
|
21
|
+
let min = Infinity;
|
|
22
|
+
for (const z of regions) {
|
|
23
|
+
const d = Math.hypot(lat - z.lat, lng - z.lon);
|
|
24
|
+
if (d < min) {
|
|
25
|
+
min = d;
|
|
26
|
+
bestId = z.regId;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return bestId;
|
|
30
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
KMA_Req_BaseMoments,
|
|
3
|
+
WeatherUtilDateTimeMoments,
|
|
4
|
+
} from "../../types";
|
|
5
|
+
import { dateFormat } from "@uniai-fe/util-functions";
|
|
6
|
+
|
|
7
|
+
export const getWeatherBaseMoments = (
|
|
8
|
+
category: "now" | "forecast",
|
|
9
|
+
): KMA_Req_BaseMoments => {
|
|
10
|
+
const FORECAST_HOURS = [2, 5, 8, 11, 14, 17, 20, 23]; // 발표 시각
|
|
11
|
+
|
|
12
|
+
const now = new Date();
|
|
13
|
+
|
|
14
|
+
let base_date = "";
|
|
15
|
+
let base_time = "";
|
|
16
|
+
|
|
17
|
+
if (category === "now") {
|
|
18
|
+
const base = new Date(now.getTime() - 10 * 60 * 1000); // 10분 보정
|
|
19
|
+
base_date = dateFormat(base).replace(/-/g, "");
|
|
20
|
+
base_time = `${base.getHours().toString().padStart(2, "0")}00`;
|
|
21
|
+
} else {
|
|
22
|
+
const hour = now.getHours();
|
|
23
|
+
const base = new Date(now);
|
|
24
|
+
let base_hour: number = hour;
|
|
25
|
+
if (hour < 2) {
|
|
26
|
+
base.setDate(base.getDate() - 1);
|
|
27
|
+
base_hour = 23;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 현재 시각 이전 중 가장 가까운 발표 시각
|
|
31
|
+
const validHour = FORECAST_HOURS.reduce(
|
|
32
|
+
(prev, curr) => (curr <= base_hour ? curr : prev),
|
|
33
|
+
FORECAST_HOURS[0],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
base_date = dateFormat(base).replace(/-/g, "");
|
|
37
|
+
base_time = `${validHour.toString().padStart(2, "0")}00`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return { base_date, base_time };
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 날씨 도구; 현재 날씨/예보 시각
|
|
45
|
+
* @util
|
|
46
|
+
* @return {WeatherUtilDateTimeMoments}
|
|
47
|
+
* @desc
|
|
48
|
+
* - now: Date 객체
|
|
49
|
+
* - today: YYYYMMDD 형식의 문자열
|
|
50
|
+
* - tomorrow: YYYYMMDD 형식의 문자열
|
|
51
|
+
* - dayAfterTomorrow: YYYYMMDD 형식의 문자열
|
|
52
|
+
*/
|
|
53
|
+
export const getMoments = (): WeatherUtilDateTimeMoments => {
|
|
54
|
+
const now = new Date();
|
|
55
|
+
const today = now.toISOString().slice(0, 10).replace(/-/g, "");
|
|
56
|
+
|
|
57
|
+
const tomorrow = new Date(now.getTime() + 86400000)
|
|
58
|
+
.toISOString()
|
|
59
|
+
.slice(0, 10)
|
|
60
|
+
.replace(/-/g, "");
|
|
61
|
+
|
|
62
|
+
const dayAfterTomorrow = new Date(now.getTime() + 2 * 86400000)
|
|
63
|
+
.toISOString()
|
|
64
|
+
.slice(0, 10)
|
|
65
|
+
.replace(/-/g, "");
|
|
66
|
+
|
|
67
|
+
return { now, today, tomorrow, dayAfterTomorrow };
|
|
68
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
GeoCoordinate,
|
|
3
|
+
KMA_GridCoordinate,
|
|
4
|
+
KMA_Req_BaseGridCoordinate,
|
|
5
|
+
WeatherCoordinate,
|
|
6
|
+
} from "../../types";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 날씨 도구; 접속위치 추출
|
|
10
|
+
* @util
|
|
11
|
+
* @return {GeoCoordinate}}
|
|
12
|
+
*/
|
|
13
|
+
export const userLocation = async (): Promise<GeoCoordinate> => {
|
|
14
|
+
if (typeof window === "undefined" || !window.navigator.geolocation) {
|
|
15
|
+
// console.log("[userLocation] window 없음");
|
|
16
|
+
return { latitude: null, longitude: null };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const position = await new Promise<GeolocationPosition>(
|
|
21
|
+
(resolve, reject) => {
|
|
22
|
+
window.navigator.geolocation.getCurrentPosition(resolve, reject);
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
// console.log("[userLocation] 위치 정보:", position.coords);
|
|
26
|
+
const res = {
|
|
27
|
+
latitude: position.coords.latitude,
|
|
28
|
+
longitude: position.coords.longitude,
|
|
29
|
+
};
|
|
30
|
+
return res;
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error("[userLocation] 위치 정보 에러", error);
|
|
33
|
+
return { latitude: null, longitude: null };
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 날씨 도구; 위경도 -> 격자 좌표 변환
|
|
39
|
+
* @util
|
|
40
|
+
* @param {GeoCoordinate} coordinate - 위경도 좌표
|
|
41
|
+
* @param {number} coordinate.latitude - 위도
|
|
42
|
+
* @param {number} coordinate.longitude - 경도
|
|
43
|
+
* @return {KMA_GridCoordinate} 격자 좌표
|
|
44
|
+
* @desc
|
|
45
|
+
* - 위경도 좌표를 기상청 격자 좌표로 변환합니다.
|
|
46
|
+
* - 출처: 기상청
|
|
47
|
+
* @see https://apihub.kma.go.kr/
|
|
48
|
+
* @see https://apihub.kma.go.kr/getAttachFile.do?fileName=%EB%8B%A8%EA%B8%B0%EC%98%88%EB%B3%B4%20%EC%A1%B0%ED%9A%8C%EC%84%9C%EB%B9%84%EC%8A%A4_API%ED%99%9C%EC%9A%A9%EA%B0%80%EC%9D%B4%EB%93%9C_241128.docx
|
|
49
|
+
*/
|
|
50
|
+
export function convertCoordinateToGrid({
|
|
51
|
+
latitude,
|
|
52
|
+
longitude,
|
|
53
|
+
}: GeoCoordinate): KMA_GridCoordinate {
|
|
54
|
+
const res: KMA_GridCoordinate = { x: 0, y: 0 };
|
|
55
|
+
|
|
56
|
+
if (latitude === null || longitude === null) return res;
|
|
57
|
+
|
|
58
|
+
const RE = 6371.00877; // Earth radius (km)
|
|
59
|
+
const GRID = 5.0; // Grid spacing (km)
|
|
60
|
+
const SLAT1 = 30.0; // Projection latitude 1 (degree)
|
|
61
|
+
const SLAT2 = 60.0; // Projection latitude 2 (degree)
|
|
62
|
+
const ORIGIN_LONGITUDE = 126.0; // Origin longitude (degree)
|
|
63
|
+
const ORIGIN_LATITUDE = 38.0; // Origin latitude (degree)
|
|
64
|
+
const XO = 43; // Origin X coordinate (GRID)
|
|
65
|
+
const YO = 136; // Origin Y coordinate (GRID)
|
|
66
|
+
|
|
67
|
+
const RADIAN = Math.PI / 180.0;
|
|
68
|
+
const re = RE / GRID;
|
|
69
|
+
const slat1 = SLAT1 * RADIAN;
|
|
70
|
+
const slat2 = SLAT2 * RADIAN;
|
|
71
|
+
const origin_longitude = ORIGIN_LONGITUDE * RADIAN;
|
|
72
|
+
const origin_latitude = ORIGIN_LATITUDE * RADIAN;
|
|
73
|
+
|
|
74
|
+
const sn =
|
|
75
|
+
Math.log(Math.cos(slat1) / Math.cos(slat2)) /
|
|
76
|
+
Math.log(
|
|
77
|
+
Math.tan(Math.PI * 0.25 + slat2 * 0.5) /
|
|
78
|
+
Math.tan(Math.PI * 0.25 + slat1 * 0.5),
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
const sf = Math.tan(Math.PI * 0.25 + slat1 * 0.5);
|
|
82
|
+
const sfPow = (Math.pow(sf, sn) * Math.cos(slat1)) / sn;
|
|
83
|
+
|
|
84
|
+
const ro =
|
|
85
|
+
(re * sfPow) /
|
|
86
|
+
Math.pow(Math.tan(Math.PI * 0.25 + origin_latitude * 0.5), sn);
|
|
87
|
+
|
|
88
|
+
const ra =
|
|
89
|
+
(re * sfPow) /
|
|
90
|
+
Math.pow(Math.tan(Math.PI * 0.25 + latitude * RADIAN * 0.5), sn);
|
|
91
|
+
let theta = longitude * RADIAN - origin_longitude;
|
|
92
|
+
if (theta > Math.PI) theta -= 2.0 * Math.PI;
|
|
93
|
+
if (theta < -Math.PI) theta += 2.0 * Math.PI;
|
|
94
|
+
theta *= sn;
|
|
95
|
+
|
|
96
|
+
res.x = Math.floor(ra * Math.sin(theta) + XO + 0.5);
|
|
97
|
+
res.y = Math.floor(ro - ra * Math.cos(theta) + YO + 0.5);
|
|
98
|
+
|
|
99
|
+
// console.log("[WEATHER] 위/경도 -> 기상청 격자값", res);
|
|
100
|
+
|
|
101
|
+
return res;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 날씨 도구; 위도/경도 -> 기상청 격자 좌표 변환
|
|
106
|
+
* @util
|
|
107
|
+
* @param {WeatherCoordinate} [coordinate] - 사용자 위치 이외의 특정 위도/경도 좌표
|
|
108
|
+
* @param {number} coordinate.lat - 위도
|
|
109
|
+
* @param {number} coordinate.lng - 경도
|
|
110
|
+
* @return {KMA_Req_BaseGridCoordinate} 기상청 격자 좌표
|
|
111
|
+
*/
|
|
112
|
+
export async function getWeatherGridLocation(
|
|
113
|
+
coordinate?: WeatherCoordinate,
|
|
114
|
+
): Promise<KMA_Req_BaseGridCoordinate> {
|
|
115
|
+
const res: KMA_Req_BaseGridCoordinate = { nx: 0, ny: 0 };
|
|
116
|
+
|
|
117
|
+
if (typeof window === "undefined") return res;
|
|
118
|
+
|
|
119
|
+
const geo: GeoCoordinate = {
|
|
120
|
+
latitude: coordinate?.lat ?? null,
|
|
121
|
+
longitude: coordinate?.lng ?? null,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// console.log("[getWeatherLocation] 특정 좌표지정 확인", coordinate);
|
|
125
|
+
|
|
126
|
+
// 특정 위경도 좌표를 받지 못하는 경우, 현재 사용자 위치로 지정
|
|
127
|
+
if (
|
|
128
|
+
typeof window !== "undefined" &&
|
|
129
|
+
(typeof coordinate === "undefined" || geo.lat === null || geo.lng === null)
|
|
130
|
+
) {
|
|
131
|
+
const { latitude, longitude } = await userLocation();
|
|
132
|
+
|
|
133
|
+
if (latitude === null || longitude === null) {
|
|
134
|
+
// console.log("[getWeatherLocation] window.navigator 실패", geo);
|
|
135
|
+
return res;
|
|
136
|
+
}
|
|
137
|
+
geo.latitude = latitude;
|
|
138
|
+
geo.longitude = longitude;
|
|
139
|
+
// console.log("[getWeatherLocation] 사용자 위치", geo);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// 위경도 좌표를 기상청 격자좌표로 변환
|
|
143
|
+
const grid = convertCoordinateToGrid(geo);
|
|
144
|
+
|
|
145
|
+
if (grid.x === 0 || grid.y === 0) {
|
|
146
|
+
// console.error("[getWeatherLocation] 위치 정보를 가져오는데 실패했습니다.", {
|
|
147
|
+
// latitude: geo.latitude,
|
|
148
|
+
// longitude: geo.longitude,
|
|
149
|
+
// });
|
|
150
|
+
return res;
|
|
151
|
+
}
|
|
152
|
+
// console.log("[getWeatherLocation] 기상청 격자좌표", grid);
|
|
153
|
+
|
|
154
|
+
res.nx = grid.x;
|
|
155
|
+
res.ny = grid.y;
|
|
156
|
+
|
|
157
|
+
// console.log("[getWeatherLocation] result", res);
|
|
158
|
+
return res;
|
|
159
|
+
}
|